就是带星星的地方:
本来我就试试删了event行吗,后来发现ie不可以,别的可以
请问这是什么讲究?
鼠标位置
The mouse pointer position is at:
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
应该是别的不可以,IE可以吧
IE有一个全局的window.event对象,其他浏览器没有
IE:有window.event对象
FF:没有window.event对象。可以通过给函数的参数传递event对象。如onmousemove=doMouseMove(event)
解决方法:
// 楼主可以看下ie事件绑定的兼容
ie:仅支持window.event
firefox:仅支持function(event
chrome:都支持
event对象在ie中是全局的window.event。在FF中是做为句柄传入的argument.0。在ie中传去参数event则会默认创建window.event,该参数与FF的event刚好相同,所以容易让人混淆。