简体   繁体   中英

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

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

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 .

It works for me: http://jsfiddle.net/jcxXH/

you can override the detection of IE noFullScreen: { msie: /msie [0-6]/, ... } to noFullScreen: { msie: /abcdefgh/ }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM