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

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

 

May we all have the power to love ourselves and others.
愿我们,都有能力爱自己,有余力爱别人
© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
May we all have the power to love ourselves and others.
愿我们,都有能力爱自己,有余力爱别人
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片快捷回复

    暂无评论内容