Answer from StackOverflow, open this page Http://jsbin.com/opuvas can, this page is also the answer person wrote.
QR code is this URL. The website has the statistic visit quantity, the author wants to know to how many people is useful, the suggestion respects the original, does not copy this webpage.
Available for both PC browser and mobile browser.
The principle is this JS:
1Window.onload =function() {2 varv8string = ' function%20javaenabled%28%29%20%7b%20%5bnative%20code%5d%20%7d ';3 4 if(Window.devicepixelratio)//If WebKit Browser5 {6 if(Escape (navigator.javaEnabled.toString ()) = = =v8string) {7Display (' V8 detected ');8}Else {9Display (' JSC detected ');Ten } One}Else { ADisplay ("Not a WebKit browser"); - } - the functionDisplay (msg) { - varp = document.createelement (' P '); -p.innerhtml =msg; - Document.body.appendChild (p); + } - +};
First, it detects the attribute Devicepixelratio peculiar to WebKit, and then detects the implementation of V8-specific javaenabled function.
Transferred from: http://blog.csdn.net/hursing/article/details/12868955
Ways to identify your browser's JavaScript engine