//浏览器IE版本判断
(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 = "你的浏览器版本太低了,已经和时代脱轨了 :(";
var str2 = "推荐使用:<a href='https://www.baidu.com/s?ie=UTF-8&wd=谷歌浏览器' target='_blank' style='color:blue;'>谷歌</a>,"
"<a href='https://www.baidu.com/s?ie=UTF-8&wd=火狐浏览器' target='_blank' style='color:blue;'>火狐</a>," "<a href='https://www.baidu.com/s?ie=utf-8&f=3&rsv_bp=1&tn=baidu&wd=IE11浏览器&oq=%E8%B0%B7%E6%AD%8C%E6%B5%8F%E8%A7%88%E5%99%A8&rsv_pq=b8d4119a000161bd&rsv_t=0381F7aojF2j91S6s6MfveyLP4BVXVQe7l814Y8JTEWpexCGFl94WjX9F7s&rqlang=cn&rsv_enter=0&rsv_sug3=12&rsv_sug1=9&rsv_sug7=100&prefixsug=I%26gt%3B11%E6%B5%8F%E8%A7%88%E5%99%A8&rsp=3&inputT=19433&rsv_sug4=19435' target='_blank' style='color:blue;'>IE</a>,"
"其他双核极速模式";
document.writeln("<pre style='text-align:center;color:red;background-color:#ccc; 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>如果你的使用的是IE浏览器,请升级到IE9及以上版本<br/></strong></h2></pre>");
document.execCommand("Stop");
};
}
})(window);
更多专业前端知识,请上 【猿2048】www.mk2048.com