所有浏览器都支持事件冒泡吗?

发布于 2024-08-02 20:12:59 字数 203 浏览 7 评论 0原文

jQuery 使用事件冒泡策略来处理事件。

而且号称是跨浏览器的,

但是“事件冒泡”是所有浏览器都支持的吗?

还有一种策略:事件捕获,与事件冒泡相反,是不是已经绝迹了?

或者我的问题可以重新表述为:

Javascript可以自行决定选择“事件捕获”策略还是“事件冒泡”策略吗?

jQuery uses event bubbling strategy to handle events.

And it claims to be cross browser,

but is "event bubbling" supported by all browsers?

There is another strategy: event capturing, which is reverse to event bubbling,is it extinct?

Or my question could be re-stated as:

Can Javascript decides on whether choosing "event capturing" strategy or "event bubbling" strategy by itself?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

再浓的妆也掩不了殇 2024-08-09 20:12:59

所有浏览器?不。例如,Lynx 根本不支持 JavaScript。

然而,事件冒泡是一个标准的 DOM 功能。 jQuery 文档没有骗你。

All browsers? No. Lynx, for instance, doesn't support JavaScript at all.

However, event bubbling is a standard DOM feature. The jQuery documentation is not lying to you.

国粹 2024-08-09 20:12:59

从 jQuery 兼容性页面,它支持以下浏览器:

  • Firefox 2+
  • IE6+
  • Safari 3+
  • Opera 9+
  • Chrome 1+

全部支持事件冒泡。

根据 W3Schools 浏览器使用页面,这些浏览器占99.2%兜售毫无意义的迂腐或者什么也没有。如果您是任何其他浏览器的用户,您可能已经远离主流,有自己的方法来处理浏览器问题。

From the jQuery compatibility page, it supports the following browsers:

  • Firefox 2+
  • IE6+
  • Safari 3+
  • Opera 9+
  • Chrome 1+

All of which support event bubbling.

According to the W3Schools browser usage page those browsers account for 99.2% of all browser usage in July 2009, I'd say this is cross-browser support covered. Ignore those peddling pointless pedantry about browser support being all or nothing. If you're a user of any other browser you are probably far enough from the mainstream to have your own methods of dealing with browser issues.

Saygoodbye 2024-08-09 20:12:59

简而言之,是的。 Netscape Navigator 4 不支持它,但我认为现在对支持 Netscape 4 没有太多担心。

In short, yes. Netscape Navigator 4 doesn't support it, but I don't think there's a lot of worry about supporting Netscape 4 these days.

秋日私语 2024-08-09 20:12:59

要么他们在撒谎,要么“跨浏览器”的定义需要稍微改变一下。它要么是跨浏览器的,要么不是,没有中间地带。

Either they are lying, or the definition for "Cross-Browser" needs to be slightly altered. It's either cross-browser or it isn't there's no in-between.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文