replaceState() operates exactly like history. pushState() except that replaceState() modifies the current history entry instead of creating a new one. replaceState() is particularly useful when you want to update the state object or URL of the current history entry in response to some user action.
The history. pushState() method allows you to add an entry to the web browser's session history stack.
Probably the best site for browser compatibility information is CanIUse. Here's the section on history.
Summary - IE9: no, IE10: yes (as of platform preview 3)
The first Release Candidate of IE9 (released 10th Feb 2011) does not support history.pushState or history.replaceState. Generally no new features are added after a product gets to RC stage so it is very unlikely that the final IE9 will support these methods.
Microsoft have a good overview for developers of the features IE9 does have.
Update: Internet Explorer 9 was launched (on 14th March 2011) and definitely does not support history.pushState()
or history.replaceState()
.
Update 2: The current platform preview of IE10 still does not support pushState / replaceState.
Update 3: Platform Preview 3 of IE10 supports the history API! Details
IE9 doesn't support it.
You can however use a work around using a Polyfill to get the functionality - History.js https://github.com/browserstate/history.js.
Modernizr do a good job listing HTML 5 Polyfills here https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills.
The caveat is that it will add a query string to your URL in browsers that only support HTML 4 features.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With