判断来访域名,来跳转

判断来访域名,来跳转,以前的location.hostname在IE9后的版本不起作用。

<script language="javascript" type="text/javascript">
 if(String(window.location.href).indexOf("www.lunji.com") < 0)
window.location.href="https://www.lunji.com/";
</script>

Leave a Reply

Your email address will not be published. Required fields are marked *