JS控制除主域名访问

 <script language="javascript">
    var fromURL = document.referrer;
    if(fromURL.indexOf("localhost:8080")<0) {
        window.location.href="http://localhost:8080/abc/404.htm"
    }
</script>

 <script language="javascript">
    if(location.host!="http://www.eguotong.com") {
            window.location.href="http://localhost:8080/abc/404.htm"
    }
</script>

 

posted @ 2014-12-25 09:57  吉利来  阅读(723)  评论(0编辑  收藏  举报