-
Notifications
You must be signed in to change notification settings - Fork 258
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
Removed $.browser #23
base: master
Are you sure you want to change the base?
Conversation
Are you going to fix it? jQuery 1.9 is here. |
+1 |
Hi, We have updated our site with jQuery 1.9 and the hashchange plugin is the only one not working! It triggers an error, please see here: #25 Please is there a quick fix, I was thinking of an alternative to detect IE? We've removed the hashchange plugin altogether for now and are actively looking at an alternative or a fix... Our entire site now suffers from missing back button support, what a shame :( |
@anonumus As per the upgrade guide, use this: https://github.com/jquery/jquery-migrate/ |
a quick and dirty fix would be to replace the one instance of ... $.browser.msie with /msie/.test(navigator.userAgent.toLowerCase()) ... this is by no means full proof |
My Solution is Open source plugin source code and replace $.browser.msie with (navigator.appName == 'Microsoft Internet Explorer') |
Better solution :) (navigator.appName === 'Microsoft Internet Explorer') |
Is there any difference in this particular case? ;-) |
Thanks all for the quick fixes ;) By the way, I'm surprised that there is no other option than this outdated plugin for an "hashchange event" in jquery, considering the popularity of sites using ajax that use URLs like /#!pageID (i.e. twitter & co...) Am I missing something? or is there another way to detect the "hashchange" event in jQuery? or is this really THE ONLY plugin that exists for this???? |
You can use "routie" : no JQuery dependency, but works only for IE8+ and modern browsers. I was used to use routie before I had to support IE7. |
@fabdouglas Did you already to look at https://github.com/andreasbernhard/history.js ? |
History.js does not handle direct links such as : <a href="www.mysite.com/#?state=1&_suid=1">Display</a> It manipulates history, so covers another web feature. (personnaly) I use jquery-hashchange to listen this internal navigation requests to load some content. This way I cover bookmarks, back, forward, etc. |
I just discovered History.js and it looks really nice!! I'm seriously considering using it! However the main concern is its huge weight, come on 20KB+ minified for one simple feature... As a comparison, jquery.ba-haschange is 2KB only... I'd rather keep with it and implement the HTML5 history stuff myself... |
We have removed the browser sniffing condition: the plugin already checks, in a better way, if browser supports the hashchange event: So we changed this line: |
Another way to fix this bug http://stackoverflow.com/questions/14512826/impromptu-with-jquery-1-9-error-with-browser-msie Tested with Jquery 1.9.1 |
Change line 300 From:
To:
That's all jQuery.browser does anyways.
|
I kind of prefer not to modify plugins directly... If you do something along these lines before you include hashchange plugin that would work as well... $.browser = {msie: (navigator.appName === "Microsoft Internet Explorer")}; not tested in IE, just thought of it from the comments above- this is assuming the fact that navigator.appName is a safe way to test for IE (yes, we know nothing is a safe way to test) |
The browser interprets the occurrence of the literal "</script>" inside of the body of a script tag as the end of the script, so the leading "<" must be escaped by replacing it with \x3c
Pull-request: cowboy#23
No description provided.