Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[html] 第356天 noscript标签有什么作用? #2194

Open
haizhilin2013 opened this issue Apr 5, 2020 · 2 comments
Open

[html] 第356天 noscript标签有什么作用? #2194

haizhilin2013 opened this issue Apr 5, 2020 · 2 comments
Labels
html html

Comments

@haizhilin2013
Copy link
Collaborator

第356天 noscript标签有什么作用?

我也要出题

@haizhilin2013 haizhilin2013 added the html html label Apr 5, 2020
@rachelcdev
Copy link

如果浏览器不支持js,noscript会帮助我们显示一些信息

https://stackoverflow.com/questions/2170484/shouldnt-we-use-noscript-element

@suukii
Copy link

suukii commented Apr 7, 2020

noscript 标签用于当浏览器不支持 JS 的时候在页面上显示一些提示内容,但是也有一些缺点,比如如果是防火墙而不是浏览器禁用了 JS,非但 JS 执行不了,noscript 的内容也不会显示。

比较好的办法是使用 noscript 作为默认方法,同时提供一个 fallback 方法,即页面上提供一个 display: block; 的 div 提示,随后使用 JS 将其设置为 display: none;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
html html
Projects
None yet
Development

No branches or pull requests

3 participants