Code Snippet
Test for Internet Explorer in JavaScript
var isMSIE = /*@cc_on!@*/0;
if (isMSIE) {
// do IE-specific things
} else {
// do non IE-specific things
}var isMSIE = /*@cc_on!@*/0;
if (isMSIE) {
// do IE-specific things
} else {
// do non IE-specific things
}
if (-[1,]) {
// do non IE-specific things
} else {
// do IE-specific things
}
doesn’t work ie 9
If you need to know if an IE browser is used purely for the sake of implementing IE-specific css rules, you can simply put the following code at the top of your html file. Basically it places an tag with a css class for ie 6 through 9.
This way u dont need any javascript to use IE-specific css code.
DigWP
A book and blog co-authored by Jeff Starr and myself about the World's most popular publishing platform.
Quotes on Design
Design, like Art, can be an elusive word to define and an awfully fun thing to have opinions about.
HTML-Ipsum
One-click copy to clipboard access to Lorem Ipsum text that comes wrapped in a variety of HTML.
Bookshelf
Hey Chris, what books do you recommend? These, young fertile mind, these.