如何检测浏览器是否禁用了javascript脚本

来源:互联网 发布:小脑袋软件好用吗 编辑:程序博客网 时间:2024/06/11 20:05

办法一:

 HttpBrowserCapabilities   bc   =   Request.Browser;  
  bool   b   =   bc.JavaScript   ;    

办法二:

    在页面上新建一个浮动层。

        <div id="jsdiv" style="width:100%; height:2500px; position:absolute; background-color:White;">

            对不起您的浏览器不支持JavaScript,请启用JavaScript!

       </div>

然后判断是否支持JavaScript如果支持则把浮动层隐藏!

 <script type="text/javascript" language="javascript">
        document.getElementById("jsdiv").style.display="none";
    </script>