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

*minor*: $.support vs $.browser #2

Open
austegard opened this issue Mar 17, 2010 · 4 comments
Open

*minor*: $.support vs $.browser #2

austegard opened this issue Mar 17, 2010 · 4 comments

Comments

@austegard
Copy link

As $.support really doesn't give you any clues as to whether or not a browser will support tracking hash history, or what lengths you need to go to to work around the lacking support for mocking the history, I can 100% see why you are using $.browser and not $.support.

That said, $.browser IS deprecated. Any plans of moving off it?

@bartaz
Copy link

bartaz commented Mar 23, 2010

As the docs http://api.jquery.com/jQuery.browser/ say:
"[...] jQuery.browser will not be removed from future versions of jQuery"

So it's not really deprecated, it's just not recommended to use it. But as there is no other way to detect hash history support it's quite reliable way for this. Especially that it's only needed for old browsers and there is no risk that any new browser will not work.

The idea behind $.support is great, but there are some cases where it's impossible (or very very hard) to use it. It's not worth to create some big and heavy support test (including iframes, additional requests and stuff) just to check if browser is IE<8.

@asual
Copy link
Owner

asual commented Mar 31, 2010

This is definitely something I'm looking into but I don't see it happening in the foreseeable future. There are too many browser and version specific cases that $.support simply doesn't handle especially when it comes to detecting Opera or older versions of Safari.

I'll leave the issue open because there is space for improvement. Things will get easier if one day we drop the support for some old browser versions.

@calumbrodie
Copy link

The use of $.browser is causing Chrome to be flagged as unsupported when using a version of jQuery earlier than 1.4 (specifically in my case - 1.3) . Chrome is detected as 'safari' and your plugin is expecting the $.browser method to return the newer 'webkit' syntax. Suggest you add support for this, because other than this the plugin works great with jQuery 1.3.

Line 410

(_mozilla && _version >= 1) ||
(_msie && _version >= 6) ||
(_opera && _version >= 9.5) ||
(_webkit && _version >= 312);

Change to

(_mozilla && _version >= 1) ||
(_msie && _version >= 6) ||
(_opera && _version >= 9.5) ||
(( _safari || _webkit) && _version >= 312);

@fooger
Copy link

fooger commented Nov 12, 2011

Hello. ASUAL, I recently came up with how to use jquery you can determine, exactly what version of IE is used. I suggest you use it (because it is more reliable than the User Agent):

var div = $('<!--[if IE 6]><script type="text/javascript">var ie_true_width_height_ie6 = true;</'+'script><![endif]-->\
<!--[if IE 7]><script type="text/javascript">var ie_true_width_height_ie7 = true;</'+'script><![endif]-->\
<!--[if IE 8]><script type="text/javascript">var ie_true_width_height_ie8 = true;</'+'script><![endif]-->\
<!--[if IE 9]><script type="text/javascript">var ie_true_width_height_ie9 = true;</'+'script><![endif]-->').appendTo('body');
$(div).remove();

I'll be glad if you use it
Sorry for my English, i know his bad, becouse i live in non-English language country)))
Thanks

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

No branches or pull requests

5 participants