either too old or too modern (!)

A few things about this source code might be amusing, but the funniest thing is that the developer writing it was clear-sighted enough to predict that a web browser "too modern" to deal with his code might one day emerge:

//PopUp Calendar BEGIN--------------
if (navigator.appName != "Netscape")
if (document.all) {
	document.writeln("<div id="PopUpCalendar" style="position:absolute; left:0px; top:0px; z-index:7; width:200px; height:77px; overflow: visible; visibility: hidden; background-color: #FFFFFF; border: 1px none #000000" onMouseOver="if(ppcTI){clearTimeout(ppcTI);ppcTI=false;}" onMouseOut="ppcTI=setTimeout('hideCalendar()',500)">");
	document.writeln("<div id="monthSelector" style="position:absolute; left:0px; top:0px; z-index:9; width:181px; height:27px; overflow: visible; visibility:inherit">");}
else if (document.layers) {
	document.writeln("<layer id="PopUpCalendar" pagex="0" pagey="0" width="200" height="200" z-index="100" visibility="hide" bgcolor="#FFFFFF" onMouseOver="if(ppcTI){clearTimeout(ppcTI);ppcTI=false;}" onMouseOut="ppcTI=setTimeout('hideCalendar()',500)">");
	document.writeln("<layer id="monthSelector" left="0" top="0" width="181" height="27" z-index="9" visibility="inherit">");}
else {
	document.writeln("<p><font color="#FF0000"><b>Error ! The current browser is either too old or too modern (usind DOM document structure).</b></font></p>");}
	document.write ("<noscript><p><font color="#FF0000"><b>JavaScript is not activated !</b></font></p></noscript>");

The result is the red warning message on this page of an airline I must be too modern to book tickets from:

So, actually, simply by switching navigator.appName from "Netscape" to "Opera" a few years back we became modern. So that's a challenge to Chrome, Firefox and IE: you know you want to be as modern as us – what are you waiting for? 🙂

7 thoughts on “either too old or too modern (!)

  1. document.write ("<noscript><p><font color="#FF0000"><b>JavaScript is not activated !</b></font>>/p></noscript>");Yeah, lets use some javascript to notify the user that javascript is disabled. Another developer that doesn't test all the use cases/paths through the code 😥

  2. Yeh, only IE is allowed to have a navigator.appName that's not "Netscape". Chrome, Firefox and Safari are to scared to not use "Netscape". 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s