10 09/2014

javascript 版本检测

最后更新: Wed Sep 10 2014 12:37:50 GMT+0800

注意:据说 这个结果并不准确!

代码:

<script type="text/javascript"> var jsver = 1.0; </script>
<script language="Javascript1.1"> jsver = 1.1; </script>
<script language="Javascript1.2"> jsver = 1.2; </script>
<script language="Javascript1.3"> jsver = 1.3; </script>
<script language="Javascript1.4"> jsver = 1.4; </script>
<script language="Javascript1.5"> jsver = 1.5; </script>
<script language="Javascript1.6"> jsver = 1.6; </script>
<script language="Javascript1.7"> jsver = 1.7; </script>
<script language="Javascript1.8"> jsver = 1.8; </script>
<script language="Javascript1.9"> jsver = 1.9; </script>

<script type="application/javascript;version=1.8"> jsver = 1.8;</script>
<script type="application/javascript;version=1.9"> jsver = 1.9;</script>
<script type="application/javascript;version=2.0"> jsver = 2.0;</script>

前面是传统办法,后面是 mozilla 的办法。

ECMAScript 对浏览器来说就是 javascript(商标属于 oracle)。ActionScript 也是 ECMAScript。

European Computer Manufacturers Association (ECMA)