Ray*_*nos 1 javascript dom dom-events dom4
var input = document.createElement("input");
input.onclick = function (ev) {
console.log(ev.timeStamp === 0 ? "WHY IS IT ZERO" : "It's not broken");
};
input.click()
var ev = document.createEvent("Event");
console.log(ev.timeStamp === 0 ? "THIS IS MADNESS" : "At least this works");
Run Code Online (Sandbox Code Playgroud)
在firefox中,第一次0使用时间戳,并且在chrome中,时间戳是一个合理的数字.
在firefox和chrome中,第二次timeStamp是一个明智的数字.
http://api.jquery.com/event.timeStamp/
注意:由于自2004年以来打开了一个错误,因此在Firefox中未正确填充此值,并且无法知道在该浏览器中创建事件的时间.
错误#238041 - nsDOMEvent :: AllocateEvent将PR_Now()分配到PRUint32
| 归档时间: |
|
| 查看次数: |
1432 次 |
| 最近记录: |