I'm working on the front end of an application using .Net/C# and JavaScript that is not optimized for Internet Explorer. Is there a way for the app to recognize if the user is using IE a trigger a popup for them to use a different browser?
Asked
Active
Viewed 119 times
1 Answers
0
Use the below JavaScript Function
function msieversion() {
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) // If Internet Explorer, return version number
{
alert(parseInt(ua.substring(msie + 5, ua.indexOf(".", msie))));
}
else // If another browser, return 0
{
alert('otherbrowser');
}
return false;
}
The userAgent property returns the value of the user-agent header sent by the browser to the server. The value returned contains information about the name, version and platform of the browser. See More Here
MSIE = The name for Internet Explorer inside of the header

Jay Mason
- 446
- 3
- 17
-
That worked perfectly! Thank you so much for your help :) – Nathan Jan 17 '19 at 13:25