-2

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.

Community
  • 1
  • 1
dvlden
  • 2,402
  • 8
  • 38
  • 61
  • 1
    Also, please see: http://stackoverflow.com/questions/10964966/detect-ie-version-in-javascript – Jim G. Oct 07 '12 at 13:34

5 Answers5

2

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

Paul Fleming
  • 24,238
  • 8
  • 76
  • 113
  • It is simpler and more reliable to use the IE conditional comments to determine the IE version. – JustEngland Oct 07 '12 at 16:55
  • @Downvoter Why the downvote? Just because this is not a certain individuals' preferred solution doesn't make it incorrect or bad practice. Reconsider your reason for down voting. – Paul Fleming Oct 07 '12 at 17:00
1

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

Detecting Windows Internet Explorer More Effectively (MSDN)

ahawkthomas
  • 656
  • 3
  • 13
  • 26
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>
Vahid
  • 584
  • 2
  • 19
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");
Hashem Qolami
  • 97,268
  • 26
  • 150
  • 164
1

Try $.browser for easy browser detection.

tomaroo
  • 2,524
  • 1
  • 19
  • 22