How to show different pages for different versions

2019-06-14 19:22发布

Possible Duplicate:
Browser detection in javascript?

I was wondering how can I detect IE 6, IE 7 and IE8 and say if any of these show different page instead of index.

Something like update.html would be just fine.

I have seen these IF IE6 and stuff but only for CSS not for index page.

Thanks in advance.

5条回答
Root(大扎)
2楼-- · 2019-06-14 19:48

There are plenty of sources describing how to detect the browser. Here's the most obvious.

查看更多
迷人小祖宗
3楼-- · 2019-06-14 19:57

Try $.browser for easy browser detection.

查看更多
我欲成王,谁敢阻挡
4楼-- · 2019-06-14 20:01

Try this HTML code:

<html>
<body>
<!--[if IE]>
<script language="javascript">
document.location = "http://www.google.com/";
</script>
<![endif]-->
redirects to google if IE
</body>
</html>
查看更多
时光不老,我们不散
5楼-- · 2019-06-14 20:01

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");
查看更多
男人必须洒脱
6楼-- · 2019-06-14 20:04

On this page there is one good script that detects IE and its version.

Detecting Windows Internet Explorer More Effectively (MSDN)

查看更多
登录 后发表回答