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.
Use this instead:
window.location.href = "http://<url>";
And as Vucko suggested, here is a way to detect IE using jQuery .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.