Open toni-moreno opened 9 years ago
You can't, IE8 doesn't support History API.
You can redirect IE8 from http://myexample.com?param1=val1¶m2=val2 to http://myexample.com#param1=va1¶m2=val2 if you want. So in your example replaceState
will change this url http://myexample.com#param1=va1¶m2=val2 to http://myexample.com#param3=val3
I don't understand what you mean.
Are you saying that I can do what I with if I use "#" instead of "?" as separator for URL and Query String?
Of course, it's not the same. History.js fallbacks to hash if browser doesn't support History API.
Browsers dont send hash part of url to server. So in IE8 you need to check hash on page load and send ajax request to server to get actual data.
supose we are in this url.
http://myexample.com?param1=val1¶m2=val2
and I set:
History.replaceState(null,null,"http://myexample.com?param3=val3");
On chrome:
URL changes to "http://myexample.com?param3=val3"
(as I wish)
On IE8:
URL changes to "http://myexample.com?param1=val1¶m2=val2#?param3=val3"
history.js attach the new parameter on the old URL, prepended with "#" instead of substitute completely.
How can I fix that ?