当前位置:开发者网络 >> 网页特效 >> 页面特效 >> 内容
精彩推荐
分类最新特效
分类热点特效
  
页面保护(可以禁止某些IP的访问)
日期:2005-06-07   人气:   【字体: 】【收藏此文


<!-- 网页特效代码由[中国WEB开发者网络:http://www.ChinaWebDev.com]提供! -->
<!-- 要实现此效果需要 1 个步骤: -->

<!-- 第 1 步: -->
<!-- 把下面的代码加到<BODY></BODY>区域中: -->

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
netscape = (navigator.appName.indexOf("Netscape") != -1);
version4 = (navigator.appVersion.indexOf("4.") != -1);

if (netscape && version4) {
ip = "" + java.net.InetAddress.getLocalHost().getHostAddress();
if (ip.indexOf("235.12") >= -1)
// 这是想要禁止访问的IP例如: 235.12.xxx.xxx

{
alert("You are not permitted to access this site.");
history.go(-1);
}
}
// End -->
</script>