Reputation: 806
I've got a client app that does not work on Internet Explorer. It does not load at all, just gives a white page.
Is there anyway we can detect and redirect based on the browser? We would like to redirect to a supported browsers page.
Thank you in advance.
Upvotes: 0
Views: 33
Reputation: 11335
I did not get any solution to detect the IE at the DNS level and redirect it. You also did not mention what kind of app it is or which technology is used.
I suggest you can try to check the console of the IE browser. It should show some error messages. based on those errors you can try to fix the issue.
Further, you can try to check the app technology for example Angular, ReactJS, etc. Try to refer to its documentation and try to make the necessary changes. So that app can at least get a load in the IE browser.
After that, you can try to check the user agent using the JS code on the first page of the app.
If it is an IE browser then you can show a message to the users that the IE browser is not supported by your site and inform them to use the supported browser. If it is any other browser then the app will get load.
Example:
<!doctype html>
<html>
<head>
</head>
<body>
<div id="info"></div>
<script>
function detectIE() {
var ua = window.navigator.userAgent;
var msie = ua.indexOf('MSIE ');
if (msie > 0) {
return "IE " + parseInt( ua.substring(msie + 5, ua.indexOf('.', msie)), 10);
}
var trident = ua.indexOf('Trident/');
if (trident > 0) {
var rv = ua.indexOf('rv:');
return "IE " + parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);
}
// other browser
return "false";
}
var result=detectIE();
if (result=="false")
{
document.getElementById("info").innerHTML +="<h2>Welcome to the site...</h2>";
}
else
{
document.getElementById("info").innerHTML += "<h2>Dear user you are using " + result + " This browser is not supported by this site. Kindly use supported browser...</h2>";
}
</script>
</body>
</html>
Output in the IE 11 browser:
Upvotes: 1