php - Seemingly Asynchronous Page Load -
i not sure call in google plus, when navigate different pages, http address changes userbars seem remain static , not reload. happening , how done?
i hope makes sense! thank you!
ajax (asynchronously loading content)
the content being loading asynchronously , url in address bar being altered.
an basic example of loading content asynchronously:
$.ajax({ url: 'http://www.example.net/load.html', datatype: 'html', success: function(data){ // replace content in body tag has been retrieved $('body').html(data); } });
see here $.ajax()
documentation.
modifying url without redirecting
to change url withour redirecting, need use html5 history api. similar question has been asked here before, please see:
modify url without reloading page
extracted answer:
function processajaxdata(response, urlpath){ document.getelementbyid("content").innerhtml = response.html; document.title = response.pagetitle; window.history.pushstate({"html":response.html,"pagetitle":response.pagetitle},"", urlpath); }
for more information on html5 history api, please see here.
Comments
Post a Comment