My programmer is on vacation so I need your help! I discovered a page that has a bug for IE users. I want to redirect all IE users to a different page.
How can I d
js code:
<script>if (/*@cc_on!@*/false || (!!window.MSInputMethodContext && !!document.documentMode)){window.location.href="https://....html";}</script>
You can also use this Boycott-IE:upgrade-your-browser
A reminder that the [if IE] solution does not apply to IE 10 or greater. This can be very annoying for "features" that have not been fixed by IE 10. I am going to try the php and java solutions and re-comment.
For Internet Explorer 10 this one works well
<script type="text/javascript">
if (navigator.appName == 'Microsoft Internet Explorer')
{
self.location = "http://www.itmaestro.in"
}
</script>
Try:
<!--[if IE]>
<script type="text/javascript">
window.location = "http://www.google.com/";
</script>
<![endif]-->
Server-side solution using PHP that's guaranteed to work on all browsers:
<?
if ( preg_match("/MSIE/",$_SERVER['HTTP_USER_AGENT']) )
header("Location: indexIE.html");
else
header("Location: indexNonIE.html");
exit;
?>
I put this in header and it works for all IE versions:
<!-- For IE <= 9 -->
<!--[if IE]>
<script type="text/javascript">
window.location = "https://google.com";
</script>
<![endif]-->
<!-- For IE > 9 -->
<script type="text/javascript">
if (window.navigator.msPointerEnabled) {
window.location = "https://google.com";
}
</script>