检测用户浏览器是否禁用了Script功能

2009-02-12 12:40:18 | 【

本脚本非常简单,当用户禁用了JavaScript,页面给出一个提示信息告诉用户打开Script限制。

查看演示页面 View Demo 查看全部代码 View Code

在网页<body>区添加以下代码

<noscript> 	
<body scroll=no style="text-align: center"><center><table border="0" style="height: 100%; width: 100%; right: 1%; left: 1%; background: black; position: fixed">
                                 	<tr><td align="center">
<div style="position: fixed; font-size: 18px; z-index: 2; cursor: help; background: #F8F8FF; width: 480px; color: black; padding: 5px 5px 5px 5px; border: 1px solid; border-color: maroon; height: auto; text-align: left; left: 20%">
<span style="font: bold 20px Arial; color:#F8F8FF; background: maroon; vertical-align: middle">NO SCRIPT ERROR:</span><br> 
     Sorry this site will not function correctly without the use of scripts.
	 The scripts are safe and will not harm your computer in anyway. 
	 Adjust your settings to allow scripts and refresh/reload browser.</div> 
		  </td></tr></table></center> 
</noscript>


注意,不能把<noscript>区添加到网页<head>区,否则无法显示提示信息

下载"检测用户浏览器是否禁用了Script功能"

  • 本地下载
  • 本地下载2

相关资源