Code:
var ie =!+ "\v1";
Just need 7bytes! See this article, "bytes, EHR ..." 9, EHR ... 7!!! To know if your browser is IE, tell the story of how foreigners make IE decision from bytes to 7 bytes!
But the record was broken by a Russian this January 8, and now only 6 bytes! it takes advantage of the difference between IE and standard browsers in handling the array's ToString method. For a standard browser, if the last character in the array identifier a comma, the JS engine automatically strips it.
Code:
Copy Code code as follows:
var ie =!-[1,];
var ie =!-[1,];
alert (IE);
If from the angle of non ie, can save a bit, because we do compatibility, most of the situation is IE and non ie to start.
Code:
Copy Code code as follows:
var notie =-[1,];
if (-[1,]) {
Alert ("This is not IE browser!") ");
}else{
Alert ("This is IE browser!") ");
}