判断是不是ie7浏览器,把https换成http(兼容ie7)

//是不是ie7浏览器
if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/7./i)=="7.") { 
    console.log("IE 7.0"); 
    //判断页面是http还是https
    var ishttps = 'https:' == document.location.protocol ? true: false;  
    //是https
    if(ishttps){  
        //把https换http
        var test = window.location.href.replace('https:', "http:")
       //再次跳转
        window.location.href = test
    }else{  
        // console.log('http');  
    }  

} 

 

posted @ 2020-09-02 10:44  YH丶浩  阅读(156)  评论(0编辑  收藏  举报