检查是否禁用JavaScript? [英] Check if javascript is disabled?

查看:642
本文介绍了检查是否禁用JavaScript?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有一个网站,使得JavaScript中使用,用户将获得该网站的最充分的经验,如果他们启用javascript,但它仍然是即使JavaScript是禁用功能齐全。有没有一种方法来检查,如果用户已禁用JavaScript,因为他们使用的浏览器,这样我就可以显示类似的消息:

If I have a website that makes use of javascript and the user will get the most full experience of the website if they have javascript enabled, but it would still be fully functional even if javascript was disabled. Is there a way to check if the user has javascript disabled for the browser they are using, so I can display a message of something like: "The website is best viewed with javascript enabled"

推荐答案

您可以使用的 < NOSCRIPT> 标记:

You could use the <noscript> tag:

<noscript>
    The website is best viewed with javascript enabled
</noscript>

您也可以看看的这篇文章了解不显眼的JavaScript。

You may also take a look at this article about unobtrusive javascript.

这篇关于检查是否禁用JavaScript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆