判断浏览器版本是否是ie9以下浏览器,提示升级
2018-02-24 22:13
656 查看
原文地址:https://www.cnblogs.com/linyongqin/articles/6936344.html
(function(window) { var theUA = window.navigator.userAgent.toLowerCase(); if ((theUA.match(/msie\s\d+/) && theUA.match(/msie\s\d+/)[0]) || (theUA.match(/trident\s?\d+/) && theUA.match(/trident\s?\d+/)[0])) { var ieVersion = theUA.match(/msie\s\d+/)[0].match(/\d+/)[0] || theUA.match(/trident\s?\d+/)[0]; if (ieVersion < 9) { var str = "你的浏览器版本太low了,已经和时代脱轨了 :("; var str2 = "推荐使用:<a href='https://www.baidu.com/s?ie=UTF-8&wd=%E8%B0%B7%E6%AD%8C%E6%B5%8F%E8%A7%88%E5%99%A8' target='_blank' style='color:blue;'>谷歌</a>," + "<a href='https://www.baidu.com/s?ie=UTF-8&wd=%E7%81%AB%E7%8B%90%E6%B5%8F%E8%A7%88%E5%99%A8' target='_blank' style='color:blue;'>火狐</a>," + "其他双核极速模式"; document.writeln("<pre style='text-align:center;color:#fff;background-color:#0cc; height:100%;border:0;position:fixed;top:0;left:0;width:100%;z-index:1234'>" + "<h2 style='padding-top:200px;margin:0'><strong>" + str + "<br/></strong></h2><h2>" + str2 + "</h2><h2 style='margin:0'><strong>如果你的使用的是双核浏览器,请切换到极速模式访问<br/></strong></h2></pre>"); document.execCommand("Stop"); }; } })(window);
<!--[if lt IE 9]> <script type="text/javascript"> var str = "你的浏览器版本太low了,已经和时代脱轨了 :("; var str2 = "推荐使用:<a href='https://www.baidu.com/s?ie=UTF-8&wd=%E8%B0%B7%E6%AD%8C%E6%B5%8F%E8%A7%88%E5%99%A8' target='_blank' style='color:blue;'>谷歌</a>," + "<a href='https://www.baidu.com/s?ie=UTF-8&wd=%E7%81%AB%E7%8B%90%E6%B5%8F%E8%A7%88%E5%99%A8' target='_blank' style='color:blue;'>火狐</a>," + "其他双核极速模式"; document.writeln("<pre style='text-align:center;color:#fff;background-color:#0cc; height:100%;border:0;position:fixed;top:0;left:0;width:100%;z-index:1234'>" + "<h2 style='padding-top:200px;margin:0'><strong>" + str + "<br/></strong></h2><h2>" + str2 + "</h2><h2 style='margin:0'><strong>如果你的使用的是双核浏览器,请切换到极速模式访问<br/></strong></h2></pre>"); document.execCommand("Stop"); </script> <![endif]-->
相关文章推荐
- 判断浏览器版本是否是ie9以下浏览器,如果是调到提示换更高级版本浏览器页面
- 用JS判断浏览器是否是IE9以下,处理可能遇到的兼容性问题,或者给出浏览器版本过低的升级提醒。
- 判断是否是IE6版本并给出提示升级浏览器
- 判断是否是IE6版本并给出提示升级浏览器
- 【转】判断浏览器版本是否是ie8以下浏览器,如果是调到提示换更高级版本浏览器页面
- 判断IE版本并给出提示升级浏览器
- 判断浏览器版本,当浏览器版本过低时提示升级浏览器,不显示原来页面内容
- 判断IE版本并给出提示升级浏览器
- 使用if IE语句判断浏览器IE版本及添加升级提示
- java后台调用JS代码判断浏览器版本是否低于IE9,低版本跳转不同页面
- 判断是否IE6,如果是则提示升级浏览器
- 判断是否IE6,如果是则提示升级浏览器
- JavaScript IE9以下浏览器版本升级提示
- 判断ie浏览器版本是否过低,然后提示更新或者使用其他浏览器
- IE9及以下版本检测提示升级
- 判断IE7以下浏览器,并提示升级
- bootstrap模板为使IE6、7、8版本(IE9以下版本)浏览器兼容html5和css3
- IE9 以下版本浏览器兼容html5
- IE9 以下版本浏览器兼容HTML5的方法
- IE9以下版本浏览器对HTML5新增标签不识别,导致CSS不起作用的问题