0

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?

Nathan
  • 77
  • 1
  • 9

1 Answers1

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