网站禁用iE6,网页上提示ie6升级

IE6的使命已经完成了。

现如今时过境迁,IE8以上和各种强势浏览器才是主流。

老板说放弃ie6.

于是我在网站上做了一个提示,禁用iE6。

首先在需要的页面加上这段:

<!–[if lte IE 6]>
<script>location.href=’/disable_ie6.html'</script>
<![endif]–>

这个if是判断ie版本。如果小于等于IE6

执行if里面的语句

我这里是用js转向到一个叫做禁用ie6的页面。这个页面我放在了网站更目录下。

这个页面代码如下:

 
[code]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Don’t allow browser</title>
</head>

<body>
<div style=" border:1px solid #f00; padding:40px; text-align:center; margin:40px">
Due to compatibility issues, our game does not support IE6. For optimal performance, please upgrade to <a href="http://windows.microsoft.com/en-us/internet-explorer/products/ie/home">IE8</a>/<a href="http://www.google.cn/chrome/intl/en-us/landing_chrome.html">Chrome</a>/<a href="http://www.mozilla.org/en-US/firefox/new/">Firefox</a>/<a href="http://www.apple.com/safari/">Safari</a>/<a target="_blank" href="http://www.opera.com">Opera</a>.
</div></body>
</html>

[/code]
就这么简单。