当前位置:编程学习 > JS >>

检测浏览器是否支持JavaScript功能

虽说一般情况下,用户不会禁用浏览器的JavaScript支持功能,但有时候无意或由其它程序会改变这些设置,本款代码可以帮助您检测用户浏览器是否打开了JavaScript俄方三个支持功能。注意,如果支持的话,本页面什么也不会显示,如果不支持,则会出现提示,你可以禁用一下Js脚本功能,然后重启浏览器测试效果。
答案:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>检测浏览器是否支持JavaScript功能</title>
</head>
<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">对不起,你的浏览器没有打开JavaScript脚本支持!</span></div> 
</td></tr></table></center> 
</noscript>
</body>
</html>

上一个:会自动关闭的JS弹出窗口特效
下一个:很漂亮的炫彩鼠标跟随特效

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,