noscript 标签的 onclick 事件的目的是什么?
阅读http://www.w3schools.com/tags/tag_noscript.asp后感到困惑关于 noscript 标签上的 onclick 事件。
有人知道目的吗?
如果没有目的,他们为什么要保留它?
感谢您提前的任何答复。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
引用 W3Schools 链接you提供的内容:
“根据 W3C 标准,
这不仅适用于 onclick,还适用于 ondblclick、onmousedown、onmousemove、onmouseout、onmouseover、onmouseup、onkeydown、onkeypress 和 onkeyup。
Quoting from the W3Schools link you provided:
"According to the W3C standard, the <noscript> tag supports event attributes. However, since the noscript element is used to provide an alternate content for users that have disabled scripts, we cannot see any use for this." -- http://www.w3schools.com/tags/tag%5Fnoscript.asp
This applies not just to onclick but also to ondblclick, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, onkeydown, onkeypress and onkeyup.
DOM 0 事件被大多数 html 元素继承,我只是认为它们没有做任何事情来阻止
noscript
继承这些事件,而这些确实是无用的。我不建议完全出于此目的使用 w3schools 作为参考,因为它确实包含了不良做法,有时信息不准确、不清楚和/或令人困惑。它拥有的#events:
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:
我怀疑标准委员会只是未能将
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 asonclick
-- base, bdo, br, frame, frameset, head, html, iframe, meta, param, script, style, and title.