Posted By

ginoplusio on 01/09/09


Tagged

javascript js ie6 ie7


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

kcmr
johnb


Detect IE6 in javascript


 / Published in: JavaScript
 

URL: http://www.barattalo.it

  1. // Internet Explorer 6
  2. var IE6 = false /*@cc_on || @_jscript_version < 5.7 @*/;
  3.  
  4. // exactly Internet Explorer 7
  5. var IE7 = false /*@cc_on || @_jscript_version == 5.7 @*/;
  6.  
  7. // at least Internet Explorer 7
  8. var gteIE7 = false /*@cc_on || @_jscript_version >= 5.7 @*/;
  9.  
  10. // any Internet Explorer (thanks to Dean)
  11. var isMSIE = /*@cc_on!@*/false;

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: johnb on February 27, 2010

When SP3 rolled out for Windows XP, all users running IE6 were upgraded to JScript 5.7.

The following is still valid: var isMSIE = /@cc_on!@/false;

A SitePoint forum post, "Good way to detect IE6 but not IE7 using object detection?", lists some other ways to detect IE6.

Props to the following articles for helping me make sense of this: 1, 2, 3

Posted By: johnb on February 27, 2010

Whoops, I didn't link to the forum post, Good way to detect IE6 but not IE7 using object detection?

Posted By: johnb on February 27, 2010

Whoops, I didn't link to the forum post, Good way to detect IE6 but not IE7 using object detection?

You need to login to post a comment.