views:

518

answers:

5

Are there any jQuery plugins or templates that people use to get poeple to stop using IE6 on their websites?
I recently saw a plugin that was very obtrusive and offensive that "warned" users of evil of IE6. I am looking for something one can show their customers.

+5  A: 

Just add a div that only IE6 users see.

<!--[if IE 6]>
<div>
  Using IE 6 will curve your spine, please upgrade your version
  of Internet Explorer or download Firefox, Opera, Safari or Chrome.
</div>
<![endif]-->
scunliffe
'lt'? Surely that should be 'lte'.
Keith Gaughan
yeah I goofed, either the hard test above, or the <!--[if IE lte 6]> version would be more complete.
scunliffe
+4  A: 

You can code it yourself with CSS.

Either use conditional comments in HTML to use a specific stylesheet for IE6

<!--[if IE6]>  whatever  <![endif]-->

or put the message in a layer (div) and make it visible only for IE6:

display: none !important;
*display: block;
Gerardo
Why use Javascript when this solution works perfectly fine.
allesklar
+2  A: 

How about this? Puts a polite notification bar at the top of the page. (Courtesy think2loud, see this link for full source, sample, css, etc.).

function badBrowser(){
    if($.browser.msie && parseInt($.browser.version) <= 6){ return true;}

    return false;
}

function getBadBrowser(c_name)
{
    if (document.cookie.length>0)
    {
    c_start=document.cookie.indexOf(c_name + "=");
    if (c_start!=-1)
     { 
     c_start=c_start + c_name.length+1; 
     c_end=document.cookie.indexOf(";",c_start);
     if (c_end==-1) c_end=document.cookie.length;
     return unescape(document.cookie.substring(c_start,c_end));
     } 
    }
    return "";
}   

function setBadBrowser(c_name,value,expiredays)
{
    var exdate=new Date();
    exdate.setDate(exdate.getDate()+expiredays);
    document.cookie=c_name+ "=" +escape(value) + ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

if(badBrowser() && getBadBrowser('browserWarning') != 'seen' ){
    $(function(){
     $("<div id='browserWarning'>You are using an unsupported browser. Please switch to <a href='http://getfirefox.com'&gt;FireFox&lt;/a&gt;, <a href='http://www.opera.com/download/'&gt;Opera&lt;/a&gt;, <a href='http://www.apple.com/safari/'&gt;Safari&lt;/a&gt; or <a href='http://www.microsoft.com/windows/downloads/ie/getitnow.mspx'&gt;Internet Explorer 7</a>. Thanks!&nbsp;&nbsp;&nbsp;[<a href='#' id='warningClose'>close</a>] </div> ")
      .css({
       backgroundColor: '#fcfdde',
       'width': '100%',
       'border-top': 'solid 1px #000',
       'border-bottom': 'solid 1px #000',
       'text-align': 'center',
       padding:'5px 0px 5px 0px'
      })
      .prependTo("body");

     $('#warningClose').click(function(){
      setBadBrowser('browserWarning','seen');
      $('#browserWarning').slideUp('slow');
      return false;
     });
    }); 
}
mb
code like that really bugs me. cut the return true/false and justreturn ($.browser.msie
Mark
code like this freaks me out. is this good code when the author does not know how booleans work? I tend to have less trust in the overall quality of code when i see things like this
mkoryak
+3  A: 

I personally find any sort of messages telling me to use a particular browser both arrogant and a sign of laziness on the part of the developer/designer.

My reasoning is that if I am somehow able to make compatible cross-browser designs, why can't others? It becomes even more trivial when you consider "browser normalizers" that exists as javascript libraries or JQuery plugins which essentially nullify the minor differences.

Here is a good example of what I mean.

Soviut
Again, i agree, i could NEVER tell a user to use a certain browser if they were a client at my JOB. On the other hand, when i make websites for free and fun, i can absolutely tell anyone anything. i have decided to not support IE6 because supporting it is boring.
mkoryak
However, you can support IE6 with a basic, non-fully functional but working version and tell users that it they would get much better experience with a better browser.Many IE6 users don't know that there are better options (not being arrogant, just factical)
Gerardo
Actually, we frequently tell users what browser they should be using and they understand why. We're not in the habit wasting our time testing with browsers that should have been replaced long ago. Strangely enough, we don't support running our software on Windows 3.1 either :-)
paxdiablo
There are a fixed set of rules to follow for IE compatibility. Most of those rules are things like "explicitly specify heading sizes". Its not any extra effort to make IE look and act the same. And its accepted that IE6 may have a degraded experience, but you should degrade gracefully.
Soviut
IE6 can cause all kinds of nightmares for developers, not just predictable display differences. I've spent tons of time on real-time visualizations where I had to write lots of extra code for IE6.
Nosredna
+5  A: 

Keep in mind that many web users are 'held up' using IE6 because of their big corporation's IT department.

They already know about the need to upgrade and your message aggravates them further. Why make them more miserable? At least give a gentle message explaining why you can't support IE6.

allesklar
They're typically not held up by their IT departments, they're held up by the technical requirements that target a specific browser like IE.
Soviut
Actually, many bigger corporate IT departments do hold up the process. +1
Ryan Duffield