<无脚本>东西不适用于 google chrome无脚本>
我想在禁用 javascript 时在我的网站顶部显示一条消息(就像在 SO 上一样),但在 google chrome 上不起作用
I wanted to display a message on the top of my site when the javascript is disabled (just like on SO), but on google chrome is not working
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
看起来是这样。
您可以使用 javascript 隐藏“noscript”消息。
Looks that way.
You can use javascript to hide a 'noscript' message.
奇怪的。我可以在 Chrome 4.1.249.1064 (45376) 中重现此内容,
但我找不到它,因此方法如下:
Odd. I can repro this in Chrome 4.1.249.1064 (45376)
I had trouble finding it, so here's how:
我有当前版本:版本30.0.1599.69 m,可以确认相同或类似的问题。
禁用 javascript 后,
请注意,这种情况只会发生一次:JavaScript 被禁用后的第一次。此后,一切都好。刷新屏幕并显示
I have the current version: Version 30.0.1599.69 m and can confirm the same or a similar issue.
With javascript disabled, html within the <noscript> tag displays verbatim, not rendered as html html is supposed to format.
Note, this happens one time and one time only: the first time after javascript is disabled. Thereafter, all is well. Refresh the screen and <noscript> works as expected. As such, someone browsing with javascript routinely disabled would not generally experience the quirk.
嗯...我已经打开了 Google Chrome,并发出了 Javascript:
当访问互联网上找到的一些
示例时,我可以看到以下消息:
http://www.java2s.com/Code/HTMLCSS/Object-Tags/noscriptExample.htm
http://www.java2s.com/Code/HTMLCSSDemo/noscriptExample.htm
所以看起来它正在工作。我有谷歌浏览器 2.0.172.39。
Hmmm... I've opened Google Chrome with Javascript issuing:
And when visiting some
<noscript>
example found on Internet I can see the message:http://www.java2s.com/Code/HTMLCSS/Object-Tags/noscriptExample.htm
http://www.java2s.com/Code/HTMLCSSDemo/noscriptExample.htm
So it looks like it's working. I have Google Chrome 2.0.172.39.
我可以使用当前的 Chrome (4.1.249.1064) 确认此错误。
这似乎不是 Webkit 问题,因为其他基于 Webkit 的浏览器支持该标签。
虽然用 Javascript 隐藏文本是可能的,但这并不是一个真正的选择;
noscript 标签是 w3c 标准的一部分,因此声称符合标准的浏览器应该支持它。
I can confirm this bug with current Chrome (4.1.249.1064).
It seems not to be a Webkit issue because other webkit-based Browsers support the tag.
Although hiding the text with Javascript may be possible, it is not really an option;
the noscript tag is part oof the w3c standard an so it should be supported by a browser that claims to be standards compliant.