$(document).ready(function(){
if(location.toString().indexOf("yangge.net") <= -1) /*如果当前网址中没有yangge.net*/
{
document.location.href="https://www.yangge.net/"; /*跳转到https://www.yangge.net*/
}
else
{
/*有的话,执行代码*/ }
})
JS判断当前域名是否符合,不符合跳转
未经允许不得转载:杨哥视界 » JS判断当前域名是否符合,不符合跳转