简体   繁体   中英

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. How has the event handling changed from IE8 to IE9 and what's the best way to stop the event in IE9? event.preventDefault() doesn't appear to stop the click event happening either.

This should be resolved as of Dojo 1.6 RC1. Give it a try.

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

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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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