You are having problems with history.js and this question , and in subsequent answers for me there were more questions.
Problem 1:
It looks like the popstate and statechange are triggered using pushState() and popState() , which according to this design-response answering machine?
I only need to listen to the popstate event, I know that I can check using the data parameter, but setting the data parameters and headers to anything other than null adds a bunch of extra things to the hash in IE8 / 9, like this:
http://www.site.com/
I know that I can create an extra var to take care of this, but I would prefer not to.
Problem 2:
Also in IE8-9, how to remove the hash for the main page, right now, if I do
History.pushState(null, null, 'http://www.site.com');
The url is as follows:
http://www.site.com/
And if I do this:
History.pushState(null, null, ''); History.pushState(null, null, '/');
The url is as follows:
http://www.site.com/
But I would like the url to take any of these formats:
http://www.site.com http://www.site.com/ http://www.site.com/
I am using jQuery history plugin.
source share