Is there any javascript plugin/library/script that will can transform a standard PHP to use ajax calls instead of standard links.
Ideally this would be something that sits on top of the existing application and allows the application to work using as normal when javascript is disabled but uses ajax when javascript is available.
It also needs to allow normal javascript plugins e.g. jeditable, jquery-ui drag n drop etc…, to work without modifications.
I did try the code below but the javascript plugins that where already loaded on the page failed to work once the page had loaded and also this only worked for one link and then the browser went back to using standard requests.
$('a').bind('click',function(event){
event.preventDefault();
$.get(this.href,{},function(response){
$('#response').html(response);
}) ;
});
Also, is there anyway to intercept the back/forward button of the browser to work correctly when the page uses ajax calls instead of the normal links.
I know I am asking… thanks
The best thing i know of is https://github.com/browserstate/History.js/ , also you should use
if you want your events to work on dynamically loaded content