DETECTING INTERNET EXPLORER 11


HOME
©2011-, mrkent.com
Around November, 2013 Microsoft released Internet Explorer 11. Some of the improvements were good but it still appears to be a problem to webmasters. In February, 2014 I noticed something locking up my server for long periods of time. At first I thought I was experiencing a Denial Of Service attack. It took some time but I found that folks using the new version of IE were the culprits. They were not at fault. It was IE that was repeatedly sending multiple requests from a mouseover script. I'm sure it cost me some clients, but life goes on.

The sad part is that Microsoft also made it very difficult to detect Internet Explorer using the old standard methods. I ended up changing my code to conform.

But recently, when having a need to really detect IE I did some serious searching for something that would do the job. The code below is what I found to work.

<script type="text/javascript">

if(window.ActiveXObject || "ActiveXObject" in window)
{
     Your programming code
}

</script>


The author stated that this works for IE 11 and the older methods of detection still work for earlier versions. But I found that my version of IE was automatically updated without my knowledge when Microsoft ran one of their operation system updates. Therefore I'm supposing that the majority of users who use IE are probably using version 11.

For more information on this you can visit the site I went to:

http://www.html5gamedevs.com/topic/3907-detect-internet-explorer-with-javascript/

There is plenty of code to choose from as they have lots of contributors.

My final code looks like this:

<script type="text/javascript">

var iedetect = 0;
if(window.ActiveXObject || "ActiveXObject" in window)
{
    iedetect = 1;
}

</script>


From there I used “iedetect” in the if-then statements.

Hopefully this helps. Happy programming!