Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect Internet Explorer 6 or below in jQuery

I'm new to jquery and was wondering: is a simple way to detect whether a browser is Internet Explorer 6 or below?

like image 553
ine Avatar asked Feb 19 '09 17:02

ine


People also ask

How do I know if I have IE 11?

In the upper corner of Internet Explorer, select the Tools button, and then select About Internet Explorer. Open Internet Explorer, at the upper right, select the Tools button, and then choose About Internet Explorer.

How do you check if browser is IE or not?

documentMode property, which is IE-specific. That means documentMode returns the undefined value on all other browsers. For the Internet Explorer browser, it returns the IE mode used to render the document. That's all about checking for IE browser with JavaScript.

Does jQuery support ie11?

jQuery UI stopped testing on IE<11 more than 2 years ago. Semantic UI supports IE 11 only.

Does jQuery support all browsers?

Cross-browser compatibility — jQuery supports older browsers which do not do well with modern tools, frameworks or libraries. jQuery-powered applications work well on all browsers.


2 Answers

As simple as this:

if($.browser.msie && $.browser.version=="6.0") alert("Im the annoying IE6");

Update

Please note that $.browser is removed from jQuery 1.9

If you still need to use $.browser in jQuery 1.9 (or other deprecated functions), try jQuery-migrate (https://github.com/jquery/jquery-migrate/ - http://code.jquery.com/jquery-migrate-1.2.1.js)

like image 139
Aamir Afridi Avatar answered Oct 20 '22 06:10

Aamir Afridi


You could also ask IE directly.

<!--[if lte IE 6]>
<script type="text/javascript">
  var isRunningIE6OrBelow = true;
</script>
<![endif]-->
like image 50
Alister Bulman Avatar answered Oct 20 '22 04:10

Alister Bulman