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

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -