How to detect IE7 with jQuery possibly using jQuery.browser?
To detect whether the current browser is Internet Explorer, you can make use of the navigator. userAgent property. The userAgent property returns the value of the user-agent header sent by the browser to the server. It contains information about the name, version, and platform of the browser.
You can use the jQuery :visible selector to check whether an element is visible in the layout or not. This selector will also select the elements with visibility: hidden; or opacity: 0; , because they preserve space in the layout even they are not visible to the eye.
Press the Alt key (next to the Spacebar) on the keyboard to open a menu bar. Click Help and select About Internet Explorer. The IE version is displayed in the pop-up window.
Got a method
if ($.browser.msie && parseInt($.browser.version, 10) === 7) { alert('IE7'); } else { alert('Non IE7'); }
-- update
Please note that $.browser is removed from jQuery 1.9
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With