Change browser Address Bar using javascript without page reloading
Usualy way of doing this is window.location=”path/here”, but this will reload the page.
If you can load the data using Ajax, you can update the location without reloading the page or without using #
|
1 2 3 4 5 |
window.history.pushState(“object or string”, “Title”, “/www.buzitweet.com”);
//To replace a history, we can use:
window.history.replaceState(“object or string”, “Title”, “/www.buzitweet.com”); |
GitHub is an example for this: https://github.com/urbanairship/ios-phonegap-plugin
Won’t work in IE
