New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error msg with IE9 #92
Comments
bump, :) anyone? |
I'm having the same issue on Internet Explorer 9 with the latest release :( The URL I'm loading is http://localhost/index.php/#./?&_suid=142 Upon initial load, I fire a History.replaceState with my new state and an empty title and url The console output is: SCRIPT5022: History.js does not support states with fragement-identifiers (hashes/anchors). If I set State.url to something, it doesn't happen anymore, but my URL gets appended whatever I set in the State, which is even more cumbersome. |
Can you confirm this is fixed in v1.7.1? |
I am still getting this error message in IE9 with 1.7.1-r2. When I first load my site, I do not get any error messages. I have If I now hit Refresh, then I see no error message. The URL is now: If I now hit Refresh again, then I see the error message again. I tried detecting the # in the URL and using |
I'm seeing this error too with the latest version from github. |
I ended up duck-punching pushState and replaceState so that they cull fragment identifiers (the hash and everything after it) from states before doing what they normally do. This seems to be working well enough for me, but I'd really rather not have to do something so cheesy. :P My project will eventually move to jQuery Mobile, so I expect I'll have to deal with whatever issues their implementation of HTML5 History introduces too. Or do they use this library too? |
I tracked my issues down to the fact that I was passing "" as the state url for the root page. This turns into "./" inside History.js which causes all sorts of issues. Using "/" doesn't cause these problems, although I am actually using some form of "?state=1", as in the examples. Ron, I noticed that you are not starting your state urls with "?". Maybe this is causing your problems. History.js tries to make the URL relative (hence "" becomes "./") and so starting with "/" might be causing your problems. Although, my understanding of this is still shakey. |
It merits further investigation. However, all of the URLs that I pass into History.JS already have slashes in them. I would hope that History.JS sees sufficient slashing and doesn't attempt any further mangling. I would consider it a bug if the presence of a question-mark (?) was either mandatory or not allowed. ?s are to help the server parse a request, the only thing a browser should care about is the hash (#) an what comes before and after it. |
I recently bumped into this issue, my urls look something like this: In html4 it modified the url to be After I changed to using |
I faced this problem and just migrated to using this plugin instead which solved my IE9 problems: |
I was getting this error on a simple test History.pushState({ step: 0, id: "AutosWidget" }, document.title, document.URL); The error was gone when I changed History.pushState({ step: 0, id: "AutosWidget" }, document.title, "?"); |
I also had the issue then I did the following and now I did not get the issue History.replaceState(null, null, '/web/search.html'); History.replaceState(null, null, '?q='+searchTerm); |
@balupton this issue is still happening on master for jquery and native bundled uncompressed versions. I'm invoking as such: The And here are the exceptions raised in IE9 for jquery and native versions: |
I can also confirm that on master, @DilipRajkumar's suggestion does not seem to fix the issue any longer. |
It also seems @pjfarsi's strategy does not work any more either, although I am using |
It seems I was mistaken. @DilipRajkumar's solution does still work. No exceptions raised in IE9. I was just expecting the URL to look different, but I had forgotten this was a "HTML4" friendly URL. So the final question here really is that do we need to draw attention to this in a README perhaps? |
One more note to this, the following solution has a side effect: Not sure if this a show stopper, but it does seem unconventional. |
Hi,
I get this error message with IE9 (probably because it's html4): History.js does not support states with fragement-identifiers (hashes/anchors)
What does this error msg mean? In which cases it pops? Any ideas of how can it be fixed?
The text was updated successfully, but these errors were encountered: