I need to ajaxify my site, like loading a spinner or something for rendering specific content in a page when clicking a link.
I have found 2 good jQuery plugins.
What is their main difference? It seems they are doing the same job. Well, maybe one uses the ajax then returns the html (pjax) and one uses a so-called html5 push state or something.
Is there another way doing this? (simpler or with only jQuery) I think it's too overkill to use either of those plugins (but I'm not sure if there is a simpler way for doing this).
author of History.js here.
So you can get PJAX to use History.js so that it supports cross browsers. There is actually a request about this here.
Though that doesn't mean History.js leaves you on your own either in regards to AJAX, it does provide you with a high-level sample for using History.js with AJAX here and you can find more info about how that was created here. Essentially that gist and PJAX do the same thing, but they have gone about them in different ways.
In regards to simpler, History.js is the most low-level basic shortest simple thing you can get which will ensure the HTML5 History API works in all browsers - that's it's aim, to be as low-level and compact as possible so other things can extend it the way they want - such as PJAX or that Gist.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With