阻止旧ie浏览页面

万恶的ie,让开发困难重重,干脆不支持好了!
下面直接阻止老旧的ie访问,

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>title</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!--[if lt IE 12]>
    <script type="text/javascript">
        document.write('<div style="position: absolute; z-index: 1000; top: 0px; left: 0px;width: 100%; height: 100%; background: white; text-align: center;"><h1 style="top: 48%; position: relative;"><font color="#15428B">不支持IE11及以下浏览器,请使用chrome!</font></h1></div>');
        //阻止浏览器继续加载后续文件
        if (!!(window.attachEvent && !window.opera)) {
            document.execCommand("stop"); //IE
        } else {
            window.stop(); //Firefox chrome
        }
    </script>
    <![endif]-->

</head>

这下世界清静了!

发布了32 篇原创文章 · 获赞 13 · 访问量 7万+

猜你喜欢

转载自blog.csdn.net/my_flash/article/details/79347888