1. Home
  2. Computing & Technology
  3. JavaScript

Antiquated Browser

Join the Discussion

Questions? Comments?

Tell people using IE6 and earlier that it is well past time that they upgraded to a more recent browserwith better security. This script is totally invisible to all web visitors apart from those using IE6 and earlier but uses my Modal Dialog Box Script along with a short piece of code added just before the </body> tag to advise IE6 users that it is about time to upgrade. I haven't included the dialog pop up on this page but if you are still using IE6 for anything other than testing your pages then you really ought to consider upgrading to a more recent version of Internet Explorer, Firefox, Opera, or Safari (or even all four - after all they are all free and you should really test in all of them).

To add the code to create a dialog popup that will appear just for those using IE6 and earlier, simply add the script and link tags for the modal dialog box script into the head of your page and then add the following code below all your content just before the </body> tag.

<div id="box" class="dialog"><div
style="text-align:center"><span id="txt">Your browser is over 10 years old and full of security holes.<br><b>Please consider upgrading.</b><br>Press OK to continue.</span><br>
<button onclick="hm('box');">OK</button></div></div>
<script type="text/javascript">
function afterload() {
/*@cc_on
@if (@_jscript_version < 5.7)
sm('box',220,110);
@end @*/
}
setTimeout('afterload()',100);
</script>
Explore JavaScript
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. JavaScript

©2009 About.com, a part of The New York Times Company.

All rights reserved.