如何检查浏览器的JavaScript或不启用 [英] How to check browser's JavaScript is enabled or not

查看:280
本文介绍了如何检查浏览器的JavaScript或不启用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序依赖于JavaScript,我要检查客户端浏览器的JavaScript或不启用并发出警报消息如果关闭了。

My application depends on JavaScript, I want to check the client browser's JavaScript is enabled or not and raise an alert message if its turned off.

推荐答案

有实际上是一个< NOSCRIPT> 标签,你可以用它来显示内容包含内部时的javascript不可用。

There's actually a <noscript> tag that you can use to display the content contained inside when javascript is not available.

是这样的:

<noscript>
    <div>
        You must enable javascript to continue.
    </div>
</noscript>

在div就不会显示如果他们有JavaScript和它的pretty容易分辨,如果JavaScript是工作,不管你是否需要它来ping您的服务器重新让它知道,还是用它来执行一些更高级的功能。

The div just won't show if they have javascript, and it's pretty easy to tell if javascript IS working, no matter whether you need it to ping your server back to let it know, or use it to perform some more advanced functions.

这篇关于如何检查浏览器的JavaScript或不启用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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