首页 > Web开发 > 详细

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

时间:2020-09-02 11:38:10      阅读:74      评论:0      收藏:0      [点我收藏+]
//是不是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‘);  
    }  

} 

 

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

原文:https://www.cnblogs.com/520yh/p/13600514.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!