判断webkit中的js引擎是否是v8

<html>
<head>
</head>
<body>
<script type="text/javascript"> 
if (window.devicePixelRatio) { //If WebKit browser
   var st = escape(navigator.javaEnabled.toString());
   if (st === 'function%20javaEnabled%28%29%20%7B%20%5Bnative%20code%5D%20%7D') {
      document.write('V8 detected');
   } else {
      document.write('other');
   }
} else {
  document.write("Not a WebKit browser");
}
</script>
</body>
</html>

posted @ 2015-03-26 11:49  带狗狗带  Views(319)  Comments(0Edit  收藏  举报