How to show different pages for different versions of IE [duplicate]

回眸只為那壹抹淺笑 提交于 2019-12-23 06:28:09

问题


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.


回答1:


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>



回答2:


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




回答3:


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

Detecting Windows Internet Explorer More Effectively (MSDN)




回答4:


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");



回答5:


Try $.browser for easy browser detection.



来源:https://stackoverflow.com/questions/12769223/how-to-show-different-pages-for-different-versions-of-ie

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!