jQuery Bug: IE reports incorrect $.browser.version

Update: This is now fixed in jQuery.
I’ve witnessed installations of IE where the navigator.userAgent reported both MSIE 6.0 and MSIE 7.0 in the same string, when Internet Explorer 7 is the one that’s really installed. Turns out, this is problemati…


This content originally appeared on Zach Leatherman and was authored by Zach Leatherman

Update: This is now fixed in jQuery.

I’ve witnessed installations of IE where the navigator.userAgent reported both MSIE 6.0 and MSIE 7.0 in the same string, when Internet Explorer 7 is the one that’s really installed. Turns out, this is problematic for jQuery version 1.2.6, as it parses the double version userAgent as Internet Explorer 6, which may cause problems with your code if you’re using $.browser.version.

You can monitor the jQuery bug in the bug tracker, or see the original research performed by Jamie Thompson. Here’s a better workaround that merges two different approaches used on Jamie’s page, which fixes $.browser.version instead of using $.browser.msie6. This is to be considered temporary until the next (fixed) version of jQuery comes out.

jQuery.browser.version = jQuery.browser.msie && /msie 7\.0/i.test(navigator.userAgent) ?
  "7.0" :
  jQuery.browser.version;


This content originally appeared on Zach Leatherman and was authored by Zach Leatherman


Print Share Comment Cite Upload Translate Updates
APA

Zach Leatherman | Sciencx (2008-10-19T05:00:00+00:00) jQuery Bug: IE reports incorrect $.browser.version. Retrieved from https://www.scien.cx/2008/10/19/jquery-bug-ie-reports-incorrect-browser-version/

MLA
" » jQuery Bug: IE reports incorrect $.browser.version." Zach Leatherman | Sciencx - Sunday October 19, 2008, https://www.scien.cx/2008/10/19/jquery-bug-ie-reports-incorrect-browser-version/
HARVARD
Zach Leatherman | Sciencx Sunday October 19, 2008 » jQuery Bug: IE reports incorrect $.browser.version., viewed ,<https://www.scien.cx/2008/10/19/jquery-bug-ie-reports-incorrect-browser-version/>
VANCOUVER
Zach Leatherman | Sciencx - » jQuery Bug: IE reports incorrect $.browser.version. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2008/10/19/jquery-bug-ie-reports-incorrect-browser-version/
CHICAGO
" » jQuery Bug: IE reports incorrect $.browser.version." Zach Leatherman | Sciencx - Accessed . https://www.scien.cx/2008/10/19/jquery-bug-ie-reports-incorrect-browser-version/
IEEE
" » jQuery Bug: IE reports incorrect $.browser.version." Zach Leatherman | Sciencx [Online]. Available: https://www.scien.cx/2008/10/19/jquery-bug-ie-reports-incorrect-browser-version/. [Accessed: ]
rf:citation
» jQuery Bug: IE reports incorrect $.browser.version | Zach Leatherman | Sciencx | https://www.scien.cx/2008/10/19/jquery-bug-ie-reports-incorrect-browser-version/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.