views:

448

answers:

1

What's the easiest way to tell if the browser is an IE 6 version in JavaScript? We're using MooTools here and Browser.Engine.trident will be true if it's IE, but what about the version number?

+3  A: 
if (Browser.Engine.trident4) alert('is IE6');
Oli
That is deprecated and doesn't exist in any version greater than the one you included a link to. Thanks anyway though.
JamesBrownIsDead
The Browser class *is* in their current docs though. Another quick Google and we have an answer.
Oli
@JamesBrownIsDead: `Browser.Engine.<engineName><engineVersion>` isn't at ALL deprecated and is infact included in all Mootools versions starting 1.2. It is just generated dynamically instead of generated statically. But if you still believe it is deprecated, use `Browser.Engine.name` and `Browser.Engine.version`. +1 to Oli.
Andrew Moore
quite, the `Browser` collection in mootools is _entirely_ based upon feature detection and not only is it not being deprecated but it's being added to (things like css3 feature detect, base64 detect, etc) are all plugins you can extend `Browser` with. I think he meant that window.ie6 (from mootools 1.1.1) got deprecated though.
Dimitar Christoff
His first comment was based on my original answer which did use the deprecated `window.ie6` attribute.
Oli