The HTML5 History API allows a web page to manipulate the contents of the history stack in order to dynamically update the URL and respond to the back button.
Questions tagged [pushstate]
635 questions
38
votes
5 answers
Is History API broken on iOS? (Location bar doesn't update on pushState)
Filing this under the either the I Can't Believe No One Noticed This Before or the I Must Be Missing Something categories:
It appears that if you do a simple window.history.pushState on iOS, the location bar doesn't update unless it is in response…

Aral Balkan
- 5,981
- 3
- 21
- 24
37
votes
3 answers
Detect whether HTML5 History supported or not
How can I check if the browser you are using supports the HTML5 history api?
As you can see here http://caniuse.com/#search=history only chrome +ff4 and several others supports this and I wish to do something else if they cant support this.
How can…

Karem
- 17,615
- 72
- 178
- 278
33
votes
2 answers
Which browsers support the HTML5 History API?
Can someone point me to a compatibility chart for browsers that support/don't support the HTML5 History API?
Spec: http://www.w3.org/TR/html5/history.html
Tutorial: https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history

Kiran Jonnalagadda
- 2,606
- 1
- 30
- 29
29
votes
4 answers
back button in browser not working properly after using pushState (in Chrome)
I am using this type of line in an JS response
if (history && history.pushState){
history.pushState(null, null, '<%=j home_path %>');
}
but when I click back in the browser, I see the JS code of the response instead of the previous page.
Is…

Nick Ginanto
- 31,090
- 47
- 134
- 244
28
votes
3 answers
How does Facebook show browser loading progress during AJAX Page Loads?
In order to keep the IM Client logged in at all times Facebook avoids full page loads by using AJAX to load its pages before inserting them into the document.
However, during Facebook AJAX requests the browser appears to be visibly loading; the…

reach4thelasers
- 26,181
- 22
- 92
- 123
26
votes
1 answer
popstate returns event.state is undefined
I am learning about history in HTML5, in this example (open the JavaScript browser console to see error) the event.state.url returns:
Uncaught TypeError: Cannot read property 'url' of undefined
Look and help: http://jsfiddle.net/un4Xk/

Caio Tarifa
- 5,973
- 11
- 46
- 73
26
votes
3 answers
Workaround for history animation in Safari for OS X Lion?
In Safari for OS X Lion, when you use the swipe gesture to navigate forward or backward in history, the window animates as though you were moving through physical pages. The problem with this behavior is that many apps already listen for changes in…

JKS
- 3,710
- 2
- 29
- 40
26
votes
2 answers
Using HTML5 pushState() in IE9
Is there any way to use HTML5 History API (pushState) in IE9?
If there is a solution for all other browsers that would be great!

Mohsen
- 64,437
- 34
- 159
- 186
22
votes
2 answers
history.pushState - not working?
I want to change html without reload. I do it like:
$('#left_menu_item').click(function(e) {
if (!!(window.history && history.pushState)) {
e.preventDefault();
history.pushState(null, null, newUrl);
}
});
It works correctly.…

indapublic
- 2,208
- 9
- 38
- 49
21
votes
6 answers
Rewriting nginx for pushState-URL's
I am trying to get nginx to work with my pushState-based URI handling that backbone.js manages for me in an Javascript app.
Right now accessing URI's with one level, eg. example.com/users works well, but not two-level or deeper URI's, such as…

Industrial
- 41,400
- 69
- 194
- 289
21
votes
1 answer
Page not reloading via 'back' when using pushState() / onpopstate
I am refreshing some pages with AJAX and so an updating the history with the following code -
/** Update the page history */
var pushState_object = {
ajax_string: ajax_string,
security: security,
};
window.history.pushState(pushState_object,…

David Gard
- 11,225
- 36
- 115
- 227
21
votes
3 answers
How to cope with refreshing page with JS History API pushState
A small website I was creating (more like fiddling) uses AJAX to load each page. Previously I was changing the hash of the url, this worked great but was ugly, and the user could refresh the page, and it would stay on the same page.
Now I have…

Jonathan.
- 53,997
- 54
- 186
- 290
20
votes
2 answers
How can I get the url of the previous page when triggering the popstate event?
Here's a simple example of pushState and popstate event: