最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - JQUERY, Warning Users that IE6 Is Not Supported are wanted - Stack Overflow

programmeradmin4浏览0评论

I'm building an app and have no intentions of support IE6 at this time. To be fair to IE6, I want IE6 users to know that and not think the app was made by incompetent developers.

I was hoping a JQUERY Plug-In would be available that would provide a nice StackOverflow style alert at the top of the page, plug & play and I'm done. Surprisingly I'm not find such a plug-in.

Does anyone know of any plug-ins that could do the IE6 Detection and as a nice to have the warning? Seems like this is a common thing these days.

Thanks

I'm building an app and have no intentions of support IE6 at this time. To be fair to IE6, I want IE6 users to know that and not think the app was made by incompetent developers.

I was hoping a JQUERY Plug-In would be available that would provide a nice StackOverflow style alert at the top of the page, plug & play and I'm done. Surprisingly I'm not find such a plug-in.

Does anyone know of any plug-ins that could do the IE6 Detection and as a nice to have the warning? Seems like this is a common thing these days.

Thanks

Share Improve this question edited Jan 19, 2010 at 2:53 Darko 38.9k15 gold badges83 silver badges107 bronze badges asked Jan 19, 2010 at 2:49 AnApprenticeAnApprentice 111k201 gold badges636 silver badges1k bronze badges 1
  • 4 also +1 for not supporting IE6. IT IS THE DEVIL – Jason Commented Jan 19, 2010 at 3:13
Add a comment  | 

4 Answers 4

Reset to default 24

Use Conditionals and CSS

If you have a header include type file, (or something like the layout in Rails), just use the IE conditionals:

<body>
   <!--[if lte IE 6]>
      <div id="ie-warning">This site does not support IE6</div>
   <![endif]-->

And then use simple styling in your stylesheet.

Or, if you really want jQuery:

Here is a simple jQuery script that does what you want. Copy this and save it to jquery.ie6.js:

(function($){
   $(function(){
      var message = "This site does not support Internet Explorer 6. Please consider downloading a <a href='http://firefox.com'>newer browser</a>.",
          div = $('<div id="ie-warning"></div>').html(message).css({
                   'height': '50px',
                   'line-height': '50px',
                   'background-color':'#f9db17',
                   'text-align':'center',
                   'font-family':'Arial, Helvetica, sans-serif',
                   'font-size':'12pt',
                   'font-weight':'bold',
                   'color':'black'
                }).hide().find('a').css({color:'#333'}).end();
      div.prependTo(document.body).slideDown(500);
    });
})(jQuery);

And then put this in the head (after the inclusion of jQuery of course) of your page:

<!--[if lte IE 6]>
   <script src="jquery.ie6.js" type="text/javascript" charset="utf-8"></script>
<![endif]-->

DEMO

This demo is set to show in all browsers, but if you include it as I showed between the if lte IE 6 conditional comments, it will only show up in IE6 and older versions of IE.

IE6Update. It's lightweight and standalone; it doesn't need jQuery, but it will work just fine if you are using jQuery.

i know this has been answered but i just found this jQuery plugin lets you put up a customised message.

http://politeiewarning.blogspot.com/

check out the jQuery.browser utility

if ($.browser.msie && jQuery.browser.version.substr(0,1)=='6') ...

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论