js代码|根据不同网址,引入不同内容
时间:2021-12-18 11:50:21 阅读:1464
<script> var r=location.href; //跳转到不同的地址,可以写多几个。 if(r.indexOf("http://网址/404.html")>-1 ){ document.title='标题是2' } else if(r.indexOf("http://网址/")>-1 ){ document.title='标题是1' } </script>
上面是根据指定网址显示某些内容
<script> var r=location.href; //跳转到不同的地址,可以写多几个。 if(r.indexOf("/user/reg.php")>-1 ){ window.location.href='/user/regsite.php'; } </script>
这个是根据指定网址跳转
网友评论