IE8 不支持Date.now()

Date.now()

返回1970 年 1 月 1日午夜与当前日期和时间之间的毫秒数。

 

以下是微软的描述:

在早于 Internet Explorer 9 的安装版本中不受支持。 但是,在以下文档模式中受到支持:Quirks、Internet Explorer 6 标准、Internet Explorer 7 标准、Internet Explorer 8 标准、Internet Explorer 9 标准和 Internet Explorer 10 标准。 在 Windows 应用商店 应用程序中也受支持。

http://msdn.microsoft.com/zh-cn/library/ie/ff679974(v=vs.94).aspx

 

但是经测试在IE8,标准模式下并未支持!

 1 <!DOCTYPE html>
 2 <html>
 3     <head>
 4         <meta charset="utf-8">
 5         <title>Date.now</title>
 6     </head>
 7     <body>
 8         <h1>Hello world.</h1>
 9         <script>alert(Date.now())</script>
10     </body>
11 </html>

posted @ 2014-10-16 11:42  周文洪  阅读(1161)  评论(0编辑  收藏  举报