Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the JScript version that's in IE9?

I want this for some conditional compilation code that will run in all IE's less than IE9.

like image 275
Paul Irish Avatar asked Apr 13 '10 19:04

Paul Irish


2 Answers

The check for less than IE9 is:

if (@_jscript_version < 9)

It's worth noting, the wikipedia crowd keeps these updated pretty well: http://en.wikipedia.org/wiki/Conditional_comment

like image 106
Nick Craver Avatar answered Nov 15 '22 16:11

Nick Craver


It is almost always better to do feature detection, not specific version (or specific browser) detection, because there's no certainty that a given version of a browser is always the same.

For example, Microsoft will release a new mobile platform soon, with its own version of IE. In the past, the mobile versions of IE have sometimes reported exactly the same version data as the desktop versions, but they've had very different features and quirks between them.

I'd also suggest using jQuery, Modernizr, and other tools to make it easier to write code without having to worry about which browser you're on.

like image 40
Spudley Avatar answered Nov 15 '22 18:11

Spudley