Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Removed $.browser #23

wants to merge 2 commits into from

Conversation

gseguin
Copy link

@gseguin gseguin commented Oct 15, 2012

No description provided.

@jazzfog
Copy link

jazzfog commented Jan 17, 2013

Are you going to fix it? jQuery 1.9 is here.

@pehrlich
Copy link

+1

@ghost
Copy link

ghost commented Feb 1, 2013

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 :(
Thanks for any help!

@pehrlich
Copy link

pehrlich commented Feb 1, 2013

@anonumus As per the upgrade guide, use this: https://github.com/jquery/jquery-migrate/

@JohnCz
Copy link

JohnCz commented Feb 2, 2013

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

@jazzfog
Copy link

jazzfog commented Feb 3, 2013

My Solution is

Open source plugin source code and replace

$.browser.msie

with

(navigator.appName == 'Microsoft Internet Explorer')

@fdaugan
Copy link

fdaugan commented Feb 9, 2013

Better solution :)

(navigator.appName === 'Microsoft Internet Explorer')

@jazzfog
Copy link

jazzfog commented Feb 9, 2013

Is there any difference in this particular case? ;-)

@ghost
Copy link

ghost commented Feb 10, 2013

Thanks all for the quick fixes ;)
Using jQuery Migrate isn't an option... we want to move forward, not backward, we have 10 others libs/plugins that work great with jQuery 1.9, this one is the oldest one without an update in 2 years.. and is the only one that triggers an error!

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????

@fdaugan
Copy link

fdaugan commented Feb 10, 2013

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.

@pthorson
Copy link

@fabdouglas Did you already to look at https://github.com/andreasbernhard/history.js ?

@fdaugan
Copy link

fdaugan commented Feb 17, 2013

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.

@ghost
Copy link

ghost commented Feb 17, 2013

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...

@danbalbo
Copy link

danbalbo commented Mar 6, 2013

We have removed the browser sniffing condition: the plugin already checks, in a better way, if browser supports the hashchange event:
supports_onhashchange = 'on' + str_hashchange in window && ( doc_mode === undefined || doc_mode > 7 );

So we changed this line:
$.browser.msie && !supports_onhashchange && (function(){
in:
!supports_onhashchange && (function(){

@sylvainlg
Copy link

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

@andey
Copy link

andey commented Apr 9, 2013

Change line 300

From:

$.browser.msie && !supports_onhashchange && (function(){

To:

/MSIE/.test(navigator.userAgent) && !supports_onhashchange && (function(){

That's all jQuery.browser does anyways.

Description: Contains flags for the useragent, read from navigator.userAgent. We recommend against using this property; please try to use feature detection instead (see jQuery.support). jQuery.browser may be moved to a plugin in a future release of jQuery.

http://api.jquery.com/jQuery.browser/

@rkingon
Copy link

rkingon commented Jul 3, 2013

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
manuelapilongo pushed a commit to rullionsolutions/cdn that referenced this pull request Aug 18, 2016
williamdes added a commit to code-lts/jquery-hashchange that referenced this pull request Apr 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants