Use conventions and CSS
If you have a header include file (or something like layout in Rails), just use IE conventions:
<body>
And then use a simple style in your stylesheet.
Or if you really want jQuery:
Here is a simple jQuery script that does what you want. Copy this and save in 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 turning on jQuery, of course) of your page:
Demo
This demo will be displayed in all browsers , but if you enable it, as I have shown conditional comments between if lte IE 6 , it will only be displayed in IE6 and older versions of IE.
Doug neiner
source share