GithubHelp home page GithubHelp logo

browserstate / ajaxify Goto Github PK

View Code? Open in Web Editor NEW
602.0 602.0 97.0 248 KB

Ajaxify your entire website instantly with this simple drop-in script using the HTML5 History API with History.js and jQuery ScrollTo.

JavaScript 100.00%

ajaxify's People

Contributors

andebians avatar balupton avatar dhr avatar tuckerwhitehouse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ajaxify's Issues

Ajaxify & Angular Controller not working

Anyone knows how to initiate an Angular controller on 'statechangecomplete'?

tweetsApp.controller('tweetsCtrl', ['$scope', '$attrs', '$http',
    function($scope, $attrs, $http, djangoUrl, linkify, $sce) {
        $scope.initTweets = function() {
                $http.get('/some/url/').
                    success(function(data, status, headers, config) {
                        $scope.tweets = data;
                });
        }
    }
]);

Content Scripts get erased

I'm updating my main content (div#container) with ajaxify. This div may contain some script tag dynamically generated from CMS. But ajaxify is removing all scripts tags within the content by "$scripts.detach();". How about options to overcome it.
EDITED:
I was wrong, ajaxify reinsert the script back. was console.loggin at wrong place.

Known issues with DFP?

Are there any known issues with Doubleclick for Publishers? I'm using Wordpress and DFP. The ads being served are part of the content that reloads each time. After clicking through to a new page, the ads are served but then disappear in a fraction of a second.

All of the scripts are properly enqueued in the WP functions file, and I haven't changed anything except the target div id to load new content into. Everything works perfectly except for this issue.

The furthest I can get in terms of diagnosing a problem is that the stock DFP script is being interfered with by "jquery.history.js" and/or "ajaxify-html5.js" (which isn't very far, I know).

I'm a bit of a jQuery/javascript neophyte, so this could be something I'm doing wrong or something easy to fix. Would anyone have an idea of what the problem might be initially?

No-ajaxy not working for dynamically created content.

I have a ".no-ajaxy" on dynamically created content but ajaxify-html5 does not seem to respect that.
Is there any workaround?

function do_something(){
$('.gallery-icon a').addClass('fancybox no-ajaxy').attr('rel', 'gallery');
}

above function is executed after every ajax requests.
I can verify that above class has been added into the element by looking in firebug.
But ajaxify-html5 seems to load that content with ajax too. How can i make sure '.no-ajaxy' class does work like expected.

Callback method

I'm curious... is there a callback we can use without having to input specific needs into the script?

I've tried hunting around, but I'm keen to add a few callbacks once the ajax method has completed; or better yet, an option beforeAjax and afterAjax.

Thanks,
R

Three questions about ajaxify

I hope this is the right place to ask these questions.

  • How does ajaxify determine which DOM elements are the content and menu containers? I haven't seen a way to pass a selector.
  • Are ajax requests cached so that a repeated request for the same link is executed faster?
  • The last questions is more related to History.js: In ist readme I've only found examples with URLs like www.mysite.com/?state=1. Can it handle pretty URLs like www.mysite.com/state/1 as well?

Update Page body class after new page load

Currently this plugin only updates a change to the document title, yet how do we update the page body class with the new page name.
both elements should update after new page has loaded.

Any suggestions

Bookmarklet miss understanding

I didn't understand... where i put this line?
javascript:var%20e=document.createElement('script');e.setAttribute('src','//rawgithub.com/browserstate/ajaxify/master/ajaxify-bookmarklet-helper.js');document.body.appendChild(e);void(0);

Thank you :)

URL in address bar is incorrect

Hi,

I am using this plugin for one my client's site at http://test.kittysu.com
Things work as intended on major browsers.
But on window's IE9 browser, I get the following issues

  1. gets added between site's root URL and the new page

  2. When you click on the homepage link(click on logo) it adds an suid url parameter
    I checked one of the sites mentioned in showcase for history.js(http://craftedpixelz.co.uk/), and that is not appending any # tags

Can you please guide me how to sort the above mentioned issues.

Thanks

Issue loading content

I'm having a little trouble getting ajaxify to load the content correctly. I have the content selector set as #content, which just contains the page content, not the header/footer or anything, but whenever I click an "ajaxified" link, it loads the whole page into the #content div. Is there anyway I can just load the #content div on pages instead of the whole page?

Also when the load is complete, the page title is display above the header as well.. any idea why?

Ajaxify cut tags in inline javascript

I have some pages. They generated inline javascript code from php. For example:

<script>
var someArray = Array();
<?foreach($videos as $num=>$code):?>
 someArray['<?=$num?>'] = '<?=$code?>';
<?endforeach;?>
</script>

$code = iframe html's from youtube (as example).
Actualy they may contain anything as <div><span>text</span></div>

So when page load directly - all work as well.
But when this page load from ajaxify inline script cut all tags in inline javascript.

What i can do for fix them? I see in ajaxify code watch for all open and closed tags, which cut and paste in document-html element and paste to result page. I want to cut inline js first and before that parse html tags. So, i think first stage is cut all around .content element, them parse inline js and after that work with other tags.

Any idea? (sry for bad english). Thanks

Wordpress: Reload plugins

Hello,

I implemented Ajaxify into a Wordpress theme and everything is working fine. But external plugins don't reload after changing pages. Their JS isn't loading again. They work only on first page load/refresh of the page.

How can I reload these plugins?

Regards

bookmarklet fails to load jquery

I get endless console.log "Loading jQuery" messages.

The script element for //raw.github.com/browserstate/ajaxify/master/ajaxify-bookmarklet-helper.js gets successfully added to the end of my

But the line in that file:
window.jQuery || document.write('<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>');

doesn't seem to actually work.

I'm using firefox 20. That document.write line doesn't seem to work when run by itself via the console. But document.write('foo'); does work.

$(document).ready() evaluation

When a page is loaded, but has <script>$(document).ready(function(){})</script> inside itself, the script is not fired, because .ready is never triggered if the page is not reloaded. is there an easy way to do that?

Ajaxify not working in Firefox

This plugin works very well (in Chrome) on a site I'm developing. In Firefox, however, ajax isn't firing at all. Is this a known issue with the plugin or could there be something else interfering with it?

Edit: I realize this is a vague question. Here's the error message I'm getting in Firebug.

-- Start Error --

ReferenceError: event is not defined
if ( event.which == 2 || event.metaKey ) { return true; }

-- End Error --

Renders script-tags as DIV โ€” messing with Handlebars.js dynamic content

Hi guys,

Great plugin.

I would like to use it on my project, where I just Handlebars.JS to render dynamic content.
However, when I just Ajaxify then the Script-tags (that Handlebars use for templating), gets converted to DIV-tags and are rendered in the DOM.

Is it possible to remain the script-tags as script-tags, so Handlebars understands them again?

Part of the UI does not refresh

Hello,
I am trying to use Ajaxify in a Mkdocs project. So far so good, however, it seems part of the markup, the Navigation in this case, does not refresh on link click and I have no idea why. There is no JS involved, just plain HTML in this case.

I am encountering this issue on Chrome.

Does not assign a current state to home-link in the menu

Love Ajaxify, fits exactly to my needs. One problem though:

I use it on a WP install. It works like a charm, but it does not assign a 'current' class to the link that points to the homepage. The home-link is also the first link in the navigation, but I changed the order and the problem was not solved. It somehow forgets to mark the homepage as active. Does not matter which page you start from, all the links work, the home-link works as well but just does not recieve a current class. Does anybody know why this is?

Keep it up, awesome work! :)

Use gh-pages branch and server js with correct mime-type

When serving a javascript file from the github.com raw url such as http://raw.github.com/browserstate/ajaxify/master/ajaxify-html5.js, it gets sent as a plain text mime-type, which cannot be used as a script in internet explorer (or at least causes issues), so it may be beneficial to some users to keep a mirror of this project on both the master branch, and gh-pages branch, and then the script could be loaded from here http://browserstate.github.com/ajaxify/ajaxify-html5.js with the correct mime-type.

Using Ajaxify with a select menu

Hi, I have a select menu with multiple options which link through to HTML pages (using value="link.html"). How difficult would it be to modify the current script so that this also works via the plugin?

Thanks in advance.

scripts doesnot work after ajaxing

page ajazification works great but after ajaxification all the scripts stop working.

here is a sample code of mine

$('.browse-all-btn').on('click', function(){
$browse.stop().slideDown();
$(this).addClass('selected');
});
$browse.on('mouseleave', function(){
$(this).stop().slideUp();
$('.browse-all-btn').removeClass('selected');
});

any help to make these script work again after ajaxification will be appreciated.
thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.