可能重复:
javascript 中的浏览器检测?
我想知道如何检测 IE 6、IE 7 和 IE8 并说其中是否有任何显示不同的页面而不是索引。
像 update.html 这样的东西就可以了。
我见过这些 IF IE6 之类的东西,但仅适用于 CSS,而不适用于索引页面。
提前致谢。
可能重复:
javascript 中的浏览器检测?
我想知道如何检测 IE 6、IE 7 和 IE8 并说其中是否有任何显示不同的页面而不是索引。
像 update.html 这样的东西就可以了。
我见过这些 IF IE6 之类的东西,但仅适用于 CSS,而不适用于索引页面。
提前致谢。
有很多资源描述了如何检测浏览器。这是最明显的。
在这个页面上有一个很好的脚本可以检测 IE 及其版本。
试试这个 HTML 代码:
<html>
<body>
<!--[if IE]>
<script language="javascript">
document.location = "http://www.google.com/";
</script>
<![endif]-->
redirects to google if IE
</body>
</html>
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");
Try $.browser for easy browser detection.