I dont want to allow users to access my site with Microsoft Internetexplorer (ANY VERSION).
What I´ve found so far was to detect if it´s lower or equal version 10.
A very annoing thing: Internetexplorer >v10 doesn´t admit to be a InternetExplorer.
What i´ve found and tried so far:
if(navigator.appVersion.indexOf("MSIE")!=-1){ alert("You use IE. That´s no good."); }
or
if ( $.browser.msie ) { alert( $.browser.version ); }
and
http://msdn.microsoft.com/en-us/library/ie/ms537509%28v=vs.85%29.aspx
I would use any solution if it is in javascript, jquery or php if there is one.
This works for me to detect any Version of the IE 5-11 (Internet Explorer) (Aug/05/2014):
if (navigator.appName == 'Microsoft Internet Explorer' || !!(navigator.userAgent.match(/Trident/) || navigator.userAgent.match(/rv:11/)) || (typeof $.browser !== "undefined" && $.browser.msie == 1)) { alert("Please dont use IE."); }
This is because each release of Internet Explorer updates the user-agent string.
MSIE
tokens have been removed in Internet Explorer 11 and $.browser
uses navigator.userAgent
to determine the platform and it is removed in jQuery 1.9.
You can use following code to determine the browser with pure java-script.
var isIE = !!navigator.userAgent.match(/Trident/g) || !!navigator.userAgent.match(/MSIE/g); if(isIE){ alert("IE"); } else{ alert("Not IE"); }
Thanks!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With