对PC浏览器和移动浏览器都可用。

其原理是这段js:
Home > Web Front-end > JS Tutorial > body text

How to identify the browser's JavaScript engine_javascript skills

WBOY
Release: 2016-05-16 17:19:30
Original
911 people have browsed it

The answer comes from StackOverflow. Just open this webpage http://jsbin.com/opuvas. This webpage is also written by the respondent himself.

The QR code is this URL. There are statistics on the number of visits to the webpage. The author wants to know how many people it is useful to. It is recommended to respect the originality and not copy this webpage.
How to identify the browser's JavaScript engine_javascript skills

Available for both PC browsers and mobile browsers.

The principle is this js:

Copy code The code is as follows:

window.onload = function() {
var v8string = 'function javaEnabled() { [native code] }';

if (window.devicePixelRatio) //If WebKit browser
{
if (escape(navigator.javaEnabled.toString()) === v8string)
{
display('V8 detected');
}
else
{
display ('JSC detected');
}
}
else {
display("Not a WebKit browser");
}

function display(msg) {
var p = document.createElement('p');
p.innerHTML = msg;
document.body.appendChild(p);
}

};

First detect the WebKit-specific attribute devicePixelRatio, and then detect the implementation of the v8-specific javaEnabled function.
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!