JS判断当前域名,执行跳转

源码 · 2021-08-21 · 338 人浏览

防止JS文件被恶意引用,防盗跳转

    host = window.location.host;
    if (host != "baidu.com") {
        location.href = "http://www.baidu.com";
    }

转载张洪儒

html js 代码
Theme Jasmine by Kent Liao