参数e是Chrome,FF和IE 9中的正确事件,但在IE 8和IE 7中是“未定义的”。在IE 9中使用F12 devtools可重现浏览器模式:IE 8和文档模式:IE 8也。
注意:该函数被正确调用我的“唯一”问题,即e未定义...
<script>
document.onmouseover = function(e) {
// parameter e is the correct event in Chrome, FF and IE 9
// but 'undefined' in IE 8 and IE 7. Reproducable in IE 9 using F12 devtools
// Browser Mode: IE 8 and Document Mode: IE 8 also.
// NOTE: The function is called properly my 'only' problem that e is undefined
... work with parameter e here
}
</script>
有什么想法吗? 提前你
答案 0 :(得分:2)
IE以不同的方式执行事件,因此它无效。
document.onmouseover = function(e) {
e = e || window.event;
}