Friday, September 21, 2012

jQuery change browser url, page content, title without loading full page

Its a jQuery technique.

TO CHANGE PAGE URL:
window.history.pushState("object or string", "Title", "/new-url");
 
TO CHANGE PAGE TITLE:
document.title = "NEW PAGE TITLE"; 
 
TO CHANGE PAGE CONTENT:
jQuery("body").html("SUCCESS"); 
 
FOR MORE INFO:
https://developer.mozilla.org/en-US/docs/DOM/Manipulating_the_browser_history 

No comments:

Post a Comment