We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
注册的事件的处理函数中的,this指向不一致: 使用addEventListener的方式注册的点击事件的回调函数中的this 指向target,但是使用attachEvent的方式注册点击事件的回调函数中的this 指向window。
3种注册事件的方式中,回调函数内获取事件对象的方式也是不一致的要让他们统一,在第二种的 事件注册方式(attachEvent)中,手动给handler传递window.event。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
注册事件的方式
兼容性问题
注册的事件的处理函数中的,this指向不一致:
使用addEventListener的方式注册的点击事件的回调函数中的this 指向target,但是使用attachEvent的方式注册点击事件的回调函数中的this 指向window。
3种注册事件的方式中,回调函数内获取事件对象的方式也是不一致的要让他们统一,在第二种的
事件注册方式(attachEvent)中,手动给handler传递window.event。
The text was updated successfully, but these errors were encountered: