This is a judgment for the IE browser versions of compact script

This is a judgment for the IE browser versions of compact script
IE browser, no matter what version they are, some are not always compatible with Web standards. For coders, this is very difficult. In order to consider the compatibility of IE, whether it is written or write CSS JS, IE will usually be special treatment, which requires some judgment. This article does not discuss how to distinguish between IE style, but decided JS IE browser.
This is the world's shortest javascript method to determine the IE browser from Russia! It has been tested on various versions of IE and other popular browsers. Based on IE bug, Microsoft has been aware of, but had never been corrected.
<Script type = 'text / JavaScript'>
var IEs =! - [1];
alert;
</ Script>
The above result code: IE returns true, false other standard browsers. ! - [1], only 6 bytes!
However, if, in turn, a standard browser returns true, IE returns false, then it can be shortened by one byte.
<script type = 'text / javascript '>
Naughtie = - [1];
if (- [1]) {
// standard browser code
} else {

Guess you like

Origin www.cnblogs.com/blogst/p/10949971.html