js判断判断当前域名javascript
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*/
}
document.location.href="/b.htm"; /*跳转到b.htm*/
}else{
document.location.href="/a.htm"; /*有的话,跳转到a.htm*/
}
上一篇:js获取当前域名
下一篇:JS切割函数split
我要评论