Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
41
rated 0 times [  48] [ 7]  / answers: 1 / hits: 193834  / 15 Years ago, thu, february 4, 2010, 12:00:00

I need to detect not only the browser type but version as well using jQuery.
Mostly I need to find out if it is IE 8 or not.



I am not sure if I am doing it correctly.



If I do :



if (jQuery.browser.version >= 8.0) {
dosomething}


I am not sure it will work for version 8.123.45.6 or will it?



Edit: Note that JQuery 2+ has dropped support for IE8 and below, and therefore can no longer be used to detect IE8. If using a current version of JQuery, it is necessary to use a Non-JQuery solution.


More From » jquery

 Answers
13

It is documented in jQuery API Documentation. Check for Internet Explorer with $.browser.msie and then check its version with $.browser.version.



UPDATE: $.browser removed in jQuery 1.9




The jQuery.browser() method has been deprecated since jQuery 1.3 and is removed in 1.9. If needed, it is available as part of the jQuery Migrate plugin. We recommend using feature detection with a library such as Modernizr.



[#97663] Monday, February 1, 2010, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
yamileth

Total Points: 53
Total Questions: 96
Total Answers: 112

Location: England
Member since Tue, Sep 8, 2020
4 Years ago
;