Skip to main content

How to Check if User is using IE

As a developer, I need today I need to check out that the user is using Internet Explorer or not. Today, I need it most but finally got 3 ways to detect Internet Explorer. All of them are given below.
Check if User is using IE

1. Using jQuery Check if User is using IE:

if ( $.browser.msie) {
  alert( "Hello! This is IE." );
}

2. Using Conditional  Comment to find if User is using IE:

<!--[if gte IE 8]>
<p>You're using a recent version of Internet Explorer.</p>
<![endif]-->

<!--[if lt IE 7]>
<p>Hm. You should upgrade your copy of Internet Explorer.</p>
<![endif]-->

<![if !IE]>
<p>You're not using Internet Explorer.</p>
<![endif]>

3. Using Javascript Check if User is using Internet Explorer:

 /**
 * Returns the version of Internet Explorer or a -1
 * (indicating the use of another browser).
 */
function getInternetExplorerVersion()
{
    var rv = -1; // Return value assumes failure.

    if (navigator.appName == 'Microsoft Internet Explorer')
    {
        var ua = navigator.userAgent;
        var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
        if (re.exec(ua) != null)
            rv = parseFloat( RegExp.$1 );
    }

    return rv;
}

function checkVersion()
{
    var msg = "You're not using Internet Explorer.";
    var ver = getInternetExplorerVersion();

    if ( ver > -1 )
    {
        if ( ver >= 8.0 ) 
            msg = "You're using a recent copy of Internet Explorer."
        else
            msg = "You should upgrade your copy of Internet Explorer.";
    }

    alert( msg );
}

4. Another Javascript If user is using IE:

/*
Internet Explorer sniffer code to add class to body tag for IE version. Can be removed if your using something like Modernizr.
 */
 var ie = (function ()
 {

     var undef,
     v = 3,
         div = document.createElement('div'),
         all = div.getElementsByTagName('i');

     while (
     div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i>< ![endif]--

>',
     all[0]);

     //append class to body for use with browser support
     if (v > 4)
     {
         $('body').addClass('ie' + v);
     }

 }());

There are three ways are given, but from all of them I got the conditional element is more easy to implement on the website.

Popular posts from this blog

Meta NOINDEX is better than Blocking Robots

Hello Friends, welcome back to the blog; today I come with topics why Meta NOINDEX is better than blocking search engines by robots. As you all know about these two properties of Search Engine Optimization but let me explain it first for new webmasters.

Meta is property that webmaster keep in head tags of a HTML webpage that helps Search Engines to know basic facts about the site.

Example of Meta Property, the given meta property is called description:
<meta content='Something about the page' name='description'/>

Robot or called as Robots.txt is another property of SEO that helps the crawlers of different search engines helps in knowing whether are the areas to crawl and what are areas not to be crawled by them.

Example of Robots.txt (Our Robot text):
Visit: http://www.youthhustle.com/robots.txt

So, the question arises why should I not to be use Robots txt for blocking robots or why Meta NOINDEX is better. The answer is very simple and clear but first known How …

Download Sanrachna Typing Tool

Sanrachna Typing Tool is an powerful unicode hindi typing tool that helps in converting English letters in Hindi. Sanrachnacan be used to write in Hindi Unicode without learning Hindi Keyboard layout. Sanrachna is compatible with all versions of Windows like Windows Vista, Windows 7, Windows 8 and Windows 8.1 too.
For Sanrachna you must need .NET Frame Work 2 installed on your PC. Sanrachna have made easy for working on many websites. Sanrachna Typing Tool is wonderful and can be onned by "pressing *Caps Lock*" for typing in hindi. If user want to type in English user need to be press *Caps Lock* again. Download Sanrachna Hindi Typing Tool for Windows VistaDownload Sanrachna Hindi Typing Tool for Windows 7 and Windows 8

Download Google Now Launcher APK 1.4.002

Google Now Launcher is orginally made by Google LLC. that gives an amazing experience to your Android device. It have included Google Now that can be used by just a left swipe over the android glass.

It can be installed on any Android which is higher than 4.1 (Jelly Bean). It have a Google Search tool right on the front screen that immediately opens Google Search that makes searching anything on Google much easier. You can even call Google just by saying "Ok Google" (You need to setup your Google Now voice command).

It have an simple up to down design of the menu. You can get all the application right there.
Download the Software (Google Now Launcher 1.4.002): File Name: Google_Now_Launcher_1.4.large-104002%28youthhustle.com%29.apk
Software Name: Google Now Launcher
Version: 1.4.002
Developer: Google LLC
Official Link: http://google.com/
Download Google Now Launcher 1.4.002