IE9 以下浏览器都支持条件判断语句,可以在 </head>
标签结束前添加如下代码做自动跳转,自定义修改提示页面地址。
方法一:
var DEFAULT_VERSION = "9.0";
var ua = navigator.userAgent.toLowerCase();
var isIE = ua.indexOf("msie") > -1;
var safariVersion;
if (isIE) {
safariVersion = ua.match(/msie ([\d.]+)/)[1]; //获取浏览器版本号
}
if (safariVersion*1 <= DEFAULT_VERSION*1) { //若版本号低于IE9,则跳转到如下页面
window.location.href = "https://www.baidu.com/"; //提示页面(修改路径)
}
方法二:
<!--[if lte IE 9]>
<script>if (!/update\.htm/.test(location.href)) window.location = '//abc.com/update.htm'; </script>
<![endif]-->
(完)