Sandy Dolphinaura
Sandy Dolphinaura

Reputation: 55

Internet Explorer 10 not redirecting

With Internet Explorer 10 removing the browser detection through markup, I need a new way to redirect users using Internet Explorer to a new page

I decided to use

<body>
<script type="text/javascript">
if (navigator.appName == 'Microsoft Internet Explorer')
   {

    self.location = "http://<url>"

   }
</script>

, but nothing is happening. I am sure that there is something little missing that I am not seeing right now.

Upvotes: 2

Views: 2387

Answers (1)

Scott
Scott

Reputation: 3765

Use this instead:

window.location.href = "http://<url>";

And as Vucko suggested, here is a way to detect IE using jQuery.

And here is how Microsoft suggests you check for IE.

Upvotes: 1

Related Questions