js判断当前域名是否符合,不符合跳转

$(document).ready(function(){
if(location.toString().indexOf("ishoud.com") <= -1) /*如果当前网址中没有ishoud.com*/
{
document.location.href="https://ishoud.com/"; /*跳转到https://ishoud.com*/
}
else
{
/*有的话,执行代码*/ }
})

 

版权声明:
作者:ForDream
链接:https://ishoud.com/index.php/2022/04/13/627.html
来源:工具人
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
海报
js判断当前域名是否符合,不符合跳转
$(document).ready(function(){ if(location.toString().indexOf("ishoud.com") <= -1) /*如果当前网址中没有ishoud.com*/ { document.location.href="h……
<<上一篇
下一篇>>