noscript 标签的 onclick 事件的目的是什么?

发布于 2024-08-07 23:22:28 字数 238 浏览 4 评论 0 原文

阅读http://www.w3schools.com/tags/tag_noscript.asp后感到困惑关于 noscript 标签上的 onclick 事件。

有人知道目的吗?

如果没有目的,他们为什么要保留它?

感谢您提前的任何答复。

After reading http://www.w3schools.com/tags/tag_noscript.asp confused about onclick event on noscript tag.

Anybody knows the purpose?

If there is no purpose, why the hell they keep it?

Thanks for any answers in advance.

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

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

发布评论

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

评论(3

很快妥协 2024-08-14 23:22:28

引用 W3Schools 链接you提供的内容:

“根据 W3C 标准,

这不仅适用于 onclick,还适用于 ondblclick、onmousedown、onmousemove、onmouseout、onmouseover、onmouseup、onkeydown、onkeypress 和 onkeyup。

戏舞 2024-08-14 23:22:28

DOM 0 事件被大多数 html 元素继承,我只是认为它们没有做任何事情来阻止 noscript 继承这些事件,而这些确实是无用的。我不建议完全出于此目的使用 w3schools 作为参考,因为它确实包含了不良做法,有时信息不准确、不清楚和/或令人困惑。

它拥有的#events:

<!ENTITY % events
 "onclick     %Script;       #IMPLIED  -- a pointer button was clicked --
  ondblclick  %Script;       #IMPLIED  -- a pointer button was double clicked--
  onmousedown %Script;       #IMPLIED  -- a pointer button was pressed down --
  onmouseup   %Script;       #IMPLIED  -- a pointer button was released --
  onmouseover %Script;       #IMPLIED  -- a pointer was moved onto --
  onmousemove %Script;       #IMPLIED  -- a pointer was moved within --
  onmouseout  %Script;       #IMPLIED  -- a pointer was moved away --
  onkeypress  %Script;       #IMPLIED  -- a key was pressed and released --
  onkeydown   %Script;       #IMPLIED  -- a key was pressed down --
  onkeyup     %Script;       #IMPLIED  -- a key was released --"
  >

The DOM 0 events are inherited by most html elements, I just don't think they did anything to prevent noscript from inheriting those, and those would be useless indeed. I would not recommend using w3schools as a reference exactly for this purpose, because it does incorporate bad practices and sometimes the information is inaccurate, unclear and/or confusing.

the #events it owns:

<!ENTITY % events
 "onclick     %Script;       #IMPLIED  -- a pointer button was clicked --
  ondblclick  %Script;       #IMPLIED  -- a pointer button was double clicked--
  onmousedown %Script;       #IMPLIED  -- a pointer button was pressed down --
  onmouseup   %Script;       #IMPLIED  -- a pointer button was released --
  onmouseover %Script;       #IMPLIED  -- a pointer was moved onto --
  onmousemove %Script;       #IMPLIED  -- a pointer was moved within --
  onmouseout  %Script;       #IMPLIED  -- a pointer was moved away --
  onkeypress  %Script;       #IMPLIED  -- a key was pressed and released --
  onkeydown   %Script;       #IMPLIED  -- a key was pressed down --
  onkeyup     %Script;       #IMPLIED  -- a key was released --"
  >
小女人ら 2024-08-14 23:22:28

我怀疑标准委员会只是未能将 noscript 添加到接受标准事件(例如 onclick -- base)的标签列表中, bdo、br、frame、frameset、head、html、iframe、meta、param、script、style 和 title。

I suspect the standards committee just failed to add noscript to the list of tags that don't accept standard events such as onclick -- base, bdo, br, frame, frameset, head, html, iframe, meta, param, script, style, and title.

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