-2

可能重复:
javascript 中的浏览器检测?

我想知道如何检测 IE 6、IE 7 和 IE8 并说其中是否有任何显示不同的页面而不是索引。

像 update.html 这样的东西就可以了。

我见过这些 IF IE6 之类的东西,但仅适用于 CSS,而不适用于索引页面。

提前致谢。

4

5 回答 5

2

有很多资源描述了如何检测浏览器。这是最明显的

于 2012-10-07T13:30:28.183 回答
1

在这个页面上有一个很好的脚本可以检测 IE 及其版本。

更有效地检测 Windows Internet Explorer (MSDN)

于 2012-10-07T13:31:14.243 回答
1

试试这个 HTML 代码:

<html>
<body>
<!--[if IE]>
<script language="javascript">
document.location = "http://www.google.com/";
</script>
<![endif]-->
redirects to google if IE
</body>
</html>
于 2012-10-07T13:32:54.207 回答
1

You can detect Browser by jQuery as easy as:

jQuery.browser
jQuery.browser.version

look here

Then check the browser name or version as above, if TRUE then redirect the page to your favorite url:

window.location.replace("http://your/address/update.html");
于 2012-10-07T13:34:47.077 回答
1

Try $.browser for easy browser detection.

于 2012-10-07T13:35:10.643 回答