if (document.referrer === ''){
document.open();
document.write('<P>非法浏览当前页面,<span id="second" >3</span>秒钟之后跳转 </p>');
document.close();
}
<script type="text/javascript">
var num = document.getElementById("second").innerHTML;
function count()
{
num--;
document.getElementById("second").innerHTML=num;
if(num==0)
{
location.assign("/www/Uwash/more/Naviget.jsp");
}
}
setInterval("count()",1000);
function back()
{
window.history.back();
}
</script>
关于禁止直接url浏览网页,并3秒返回指定页面
最新推荐文章于 2025-06-14 05:27:40 发布
本文介绍了一种使用JavaScript实现的非法访问检测与自动跳转的方法。通过检查referrer来判断是否为非法访问,并利用innerHTML动态更新倒计时,最后通过location.assign实现页面跳转。
2466

被折叠的 条评论
为什么被折叠?



