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
325
votes
18 answers
S3 Static Website Hosting Route All Paths to Index.html
I am using S3 to host a javascript app that will use HTML5 pushStates. The problem is if the user bookmarks any of the URLs, it will not resolve to anything. What I need is the ability to take all url requests and serve up the root index.html in my…

Mark Nutter
- 5,449
- 4
- 15
- 12
225
votes
16 answers
How to get notified about changes of the history via history.pushState?
So now that HTML5 introduces history.pushState to change the browsers history, websites start using this in combination with Ajax instead of changing the fragment identifier of the URL.
Sadly that means that those calls cannot be detect anymore by…

Felix Kling
- 795,719
- 175
- 1,089
- 1,143
167
votes
9 answers
Good tutorial for using HTML5 History API (Pushstate?)
I am looking into using the HTML5 History API to resolve deep linking problems with AJAX loaded content, but I am struggling to get off the ground. Does any one know of any good resources?
I want to use this as it seems a great way to allow to the…

Mild Fuzz
- 29,463
- 31
- 100
- 148
140
votes
4 answers
Does Internet Explorer support pushState and replaceState?
Does anybody know if Internet Explorer supports the history.pushState() and history.replaceState() methods for manipulating browser history? Considering these are just being implemented in Firefox 4, I'm not holding my breath, but does anybody know…

David Johnstone
- 24,300
- 14
- 68
- 71
127
votes
9 answers
"Single-page" JS websites and SEO
There are a lot of cool tools for making powerful "single-page" JavaScript websites nowadays. In my opinion, this is done right by letting the server act as an API (and nothing more) and letting the client handle all of the HTML generation stuff.…

user544941
- 1,579
- 2
- 12
- 16
106
votes
6 answers
Appending parameter to URL without refresh
I know this has been asked many times before but answers were not descriptive enough to solve my problem. I don't want to change the whole URL of page. I want to append a parameter &item=brand on button click without refresh.
Using…

Mina Hafzalla
- 2,681
- 9
- 30
- 44
86
votes
2 answers
How do I retrieve if the popstate event comes from back or forward actions with the HTML5 pushstate?
I'm developing a webpage where depending on the next or back actions I do the correspondent animation, the problem comes when using the pushstate. When I receive the event how do I know if the user clicked back or forward history buttons using the…

Davsket
- 1,248
- 1
- 9
- 14
83
votes
3 answers
pushState and SEO
Many people have been saying, use pushState rather than hashbang.
What I don't understand is, how would you be search-engine friendly without using hashbang?
Presumably your pushState content is generated by client-side JavaScript code.
The scenario…

Harry
- 52,711
- 71
- 177
- 261
77
votes
11 answers
SecurityError: The operation is insecure - window.history.pushState()
I'm getting this error in Firefox's Console: SecurityError: The operation is insecure and the guilty is HTML5 feature: window.history.pushState() when I try to load something with AJAX. It is supposed to load some data but Javascript stops executing…

Atadj
- 7,050
- 19
- 69
- 94
75
votes
3 answers
pushState: what exactly is the state object for?
I've read a dozen of times now that the state object could exists of multiple key|value pairs and that it is associated with the new history entry.
But could someone please give me an example of the benefits of the state object? Whats the practical…

campari
- 985
- 2
- 8
- 11
51
votes
1 answer
How to detect when history.pushState and history.replaceState are used?
Is there some event I can subscribe to when the history state is modified? How?

BrunoLM
- 97,872
- 84
- 296
- 452
49
votes
3 answers
How to trigger change when using the back button with history.pushstate and popstate?
I'm pretty much a novice when it comes to js so I'm sorry if I'm missing something really simple.
Basically, I've done some research into using the history.pustate and popstate and I've made it so a query string is added to the end of the url…

Rwd
- 34,180
- 6
- 64
- 78
49
votes
3 answers
window.history.pushState refreshing the browser
I am working on some javascript code, and using window.History.pushState to load new HTML pages, instead of using href tags. My code (which is working fine) looks like this.
window.History.pushState({urlPath:'/page1'},"",'/page1')
strangely, this…

Ankit Rustagi
- 5,539
- 12
- 39
- 70
46
votes
1 answer
How to find if a browser supports History.Pushstate or not?
I want to change URL without without reloading the page. The possible solution I found is
window.history.pushState('page2', 'Title', '/page2.php');
but some browser like Firefox 3.5, IE6+ does not support this, so for them solution is
var uri =…

Ashish Agarwal
- 6,215
- 12
- 58
- 91
39
votes
9 answers
What are the differences between history.pushState & location.hash?
I want to update the URL using window.location.hash or history.pushState.
What are the differences and advantages of each method?

Krueger
- 1,178
- 3
- 11
- 26