Internet Explorer Detection

This is something crucial for me, as a front end guy, designing web pages and javascript based on normal browsers (those other than Internet Explorer). When it comes to IE, I have to make sure that I have to change the JavaScript and Design altogether, as IE is another kind of species, which do not follow anything normal and have things for granted and does whatever it likes.

It has its own proprietary attributes, elements, functions, which are not standard and doesn't work across all other browsers. But other browsers are generous enough to understand that this site is done primarily keeping IE in mind and render as how IE renders.

For Eg., the element <MARQUEE> is a propreitary one of Microsoft and it has been adopted in Google Chrome, thanks to Google Developers! Some serious stuffs have been ignored, such as filter CSS attribute, which is purely proprietary to IE only! It does almost all the functions, which CSS 3 does, but it is not supported in any other browsers. But, those things, which CSS 3 can do, are supported across all the browsers but not IE!!!

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • PraveenKumar Purushothaman

    @praveenkumar-66Ze92 • Jul 30, 2012

    This made me to do something like a script to detect Internet Explorer using PHP (as almost all the apps I do are powered by PHP and it is Open Source too). The code goes this way: ifย (ย eregi("MSIE",ย getenv(ย "HTTP_USER_AGENT"ย )ย )ย ||ย eregi("Internetย Explorer",ย getenv("HTTP_USER_AGENT"ย )ย )ย )ย {
    ย ย 
    //ย doย something
    }
    Okay, lets see what this script does. The function eregi() is a search function, which finds a pattern or string in another string, using Regular Expressions and returns true if it is found.

    The getenv() function is used to get the environment of the client and server system. The string HTTP_USER_AGENT is the User Agent String, which is sent by the user's browser containing the information about the browser and the operating system. Typically a User Agent string of Internet Explorer looks this way:

    Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)

    So you can see that, there's information about my Browser Engine, my Operating System, and Browser Version! Here, MSIE 9.0 is my browser, which is Internet Explorer 9.0. I am using Windows 7, which is Windows NT 6.1. IE has a Trident rendering engine, which is of version 5.0! The script finds out if there's a string MSIE or Internet Explorer in the User Agent String and makes decisions based on it.

  • [Prototype]

    @prototype-G9Gn5k • Aug 1, 2012

    You can as well use the #-Link-Snipped-# feature of php. However it requires browscap.ini which is not bundled with php by default.

  • PraveenKumar Purushothaman

    @praveenkumar-66Ze92 • Aug 1, 2012

    [Prototype]You can as well use the #-Link-Snipped-# feature of php. However it requires browscap.ini which is not bundled with php by default.

    Yup, now there are more and more plugins available, but the problem is we need to make sure that it is updated often... ๐Ÿ˜€