comu
comu

Reputation: 921

Change browser URI without page reload

How do I change the browser URL (or URI) without a page refresh using HTML5 and HTML5Shiv for IE? For instance if I am on the page http://www.example.com and I want to go to http://www.example.com/4f6gt without having to reload the page. I understand how to load the content with AJAX, I have been using AJAX for a while now, but I am new to the HTML5 point of view for this. The reason I wanna do this is because I wanna be able to have people navigate pages without the time it takes to reload the DOM of the main page, but have a deep link that they can also go to so they have a one step way to get back. Thanks!!

Upvotes: 1

Views: 860

Answers (1)

Christian
Christian

Reputation: 19750

Check out pjax or history.js

It's not going to work in < IE9, because IE doesn't support html5 history api (history.pushState() and history.replaceState()). The shim won't help. Should work in IE10.

Both those plugins degrade gracefully. History.js can also degrade with a hashbang to support dynamic content loads.

Upvotes: 3

Related Questions