js判断判断当前域名javascript

/ / 2019-07-11   阅读:2495
if(location.toString().indexOf("abc.com") <= -1){     /*如果当前网址中没有abc.com*/  document.location.href="/b.htm";   /*跳转到b.htm*/  }else{ document.locati...
if(location.toString().indexOf("abc.com") <= -1){     /*如果当前网址中没有abc.com*/ 
document.location.href="/b.htm";   /*跳转到b.htm*/ 
}else{
document.location.href="/a.htm";   /*有的话,跳转到a.htm*/
}

上一篇:js获取当前域名

下一篇:JS切割函数split

我要评论

昵称:
验证码:

最新评论

共0条 共0页 10条/页 首页 上一页 下一页 尾页
意见反馈