Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

$.browser.msie and IE9

I am trying to detect ALL versions of IE by using jquery $.browser.msie. It works for 8, 7, 6, but it ignores IE9. Why is that and what is a solution for javascript to detect ie9?

JS version: jQuery JavaScript Library v1.5

like image 536
Stewie Griffin Avatar asked Jul 11 '11 19:07

Stewie Griffin


2 Answers

As of version 1.9 of jQuery $.browser is no longer supported. Use jQuery.suport instead. With this change you'll need to check on what functionality you want to check. So just browser check is no longer supported in it. It is recommended to do a feature check instead of browser check.

Docs here

like image 142
Rene Pot Avatar answered Oct 26 '22 16:10

Rene Pot


IE9 can emulate older browsers, causing the variety of "works/doesn't work" responses you see here.

"Trident/5.0" is present in IE9's user-agent string in all modes, according to this SO question.

like image 43
George Cummins Avatar answered Oct 26 '22 16:10

George Cummins