I make a ajax request with .load. It is working good. But i have a problem with the url bar. I want change the url bar. For example. When the ajax loads about/contact page. I want to change the url bar to about/contact.
I used this.
window.location.replace = about/contact;
But now, he redirect direct to this page. But I do not want, that the page is redirect to that url. How can i fix that?
Thanks!
You can do this with the History API, though support is not universal yet, though good in browsers other than IE. For an example of it in use: http://html5demos.com/history. It will modify the visible URL as you want, and will also allow you to use the back button to go back to previous states.
Suggest you use something like history.js to this as it behaves accordingly for browsers that do not yet support the history API. It will use the History API first, and if that isn’t present will use the hash technique.
If you want to do-it-yourself, then definately look up on the History API and how it works, here’s some places to start: article 1, article 2