Open jmasse opened 11 years ago
I had the same issue, your hack seems to fix the problem for me.
Ok :-)
Date: Wed, 28 Aug 2013 06:10:04 -0700 From: notifications@github.com To: sammy@noreply.github.com CC: jonathanmasse@hotmail.com Subject: Re: [sammy] IE10 problem -> Sometime the callback from jquery (location onhashchange is not called) (#193)
I had the same issue, your hack seems to fix the problem for me.
— Reply to this email directly or view it on GitHub.
Fixed it for me too.
Fixed for me too
I had this problem problem in IE11 with Sammy 0.7.5 and Jquery 1.11.1. This Hack appears to have fixed the issue for me as well.
In my case the issue starts happening when someone refreshes the page, from that point on any window.location.href calls simply set the Url, but do not trigger any Sammy events.
Encountered the same issue in IE11 and IE10 with Sammy 0.7.6 an jQuery 1.11.2. This fix seems to have fixed the issue for me as well. Thanks for posting.
What an awful hack. The same could be achieved by dropping everything related to the HTML5 history.
// HTML5 History exists and new_location is a full path
// if (_has_history && !this.app.disable_push_state && /^\//.test(new_location)) {
// history.pushState({ path: new_location }, window.title, new_location);
// this.app.trigger('location-changed');
// } else {
return (window.location = new_location);
// }
but a much cleaner way to get the same result is to set disable_push_state
to true
for your routes.
Sammy('body', function () {
this.disable_push_state = true;
...
To repair this issue on IE10 i have this workaround.
I added window.location.hash = new_location; at line : 347.
After that, the callback is working perfectly :-)