简体   繁体   English

在IE9 beta中阻止点击事件传播的最佳方法是什么?

[英]What's the best way to stop a click event propagating in IE9 beta?

dojo.stopEvent no longer appears to stop the default action of a click event (or a submit event) in IE9. dojo.stopEvent不再显示来停止IE9中的单击事件(或提交事件)的默认操作。 How has the event handling changed from IE8 to IE9 and what's the best way to stop the event in IE9? 如何将事件处理方式从IE8更改为IE9,在IE9中停止事件的最佳方法是什么? event.preventDefault() doesn't appear to stop the click event happening either. event.preventDefault()似乎也不会停止发生click事件。

This should be resolved as of Dojo 1.6 RC1. 从Dojo 1.6 RC1起应该解决此问题。 Give it a try. 试试看。

http://download.dojotoolkit.org/release-1.6.0rc1/ http://download.dojotoolkit.org/release-1.6.0rc1/

http://bugs.dojotoolkit.org/ticket/12257 http://bugs.dojotoolkit.org/ticket/12257

Sounds like Dojo is browser sniffing and providing IE-only implementations of event handling code based on the user agent string, and a quick look at the source code suggests this is the case too. 听起来Dojo正在浏览器中嗅探并基于用户代理字符串提供事件处理代码的仅IE实现,而快速查看源代码也表明情况也是如此。 This is bad behaviour for a general purpose library, which should be using feature detection, especially since feature detection in this case is trivially easy. 对于应使用特征检测的通用库而言,这是不好的行为,特别是因为在这种情况下特征检测非常容易。

My advice: ditch Dojo, if it's too incompetent to deal with this. 我的建议:沟渠道场,如果它太无能处理这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM