HTML5 Zone is brought to you in partnership with:

I love technology. Plain and simple. You can generally find me writing software, figuring out how to get rid of cable, playing on my Xbox, or traveling around this country speaking about software development. If you're doing something cool with technology, let me know. I'd love to hear your story about something amazing. You can find my blog at jeffblankenburg.com Jeff is a DZone MVB and is not an employee of DZone and has posted 71 posts at DZone. You can read more from them at their website. View Full User Profile

Ah, the wonders of DHTML...

10.03.2012
| 7225 views |
  • submit to reddit

Yes, that’s not a typo.  This article should have been published 10 years ago.  It’s about DHTML, and apparently Netscape 4.7.

Today, I was cleaning my office and found an old journal that I had created in the summer of 2000.  It was a set of specific workaround for the different browsers at the time, like Internet Explorer 4 and Netscape Navigator 4.7.

Internet Explorer 5 logo.svg                                                           

Here’s a look at a few of the pages from this journal:

WP_000381

Browser compatibility was so bad that I actually kept a journal of all of the workarounds I had discovered.

WP_000384 (1)

Scrolling in Netscape 4.7 with <DIV>s

If you have a <DIV> that extends outside the viewable browser windows, the scrollbars will not show up in Netscape 4.7, if you have

marginheight=0 marginwidth=0

in your <BODY> tag.

WP_000386 (1)

Referencing <DIV>s in IE 4.0+, Netscape Navigator 4.7, and Netscape 6.0

First, each <DIV> should be an independent element whose direct parent is the <BODY>.

IE 4.0+     document.all.divName.style.attribute

NN 4.7       document.divName.attribute

NN 6.0       document.getElementById(“divName”).style.attribute

WP_000383 (1)

Radio Button Backgrounds

If you have a radio button in a table cell which has a different background color than the <body>, Netscape 4.7 will apply the background color of the body to the radio button.

To prevent this, apply a CSS class directly to the radio button tag.

<input type=”radio” name=”radio2” class=”whiteRadio”>

 

WP_000387 (1)

Javascript Date Functions

date = new Date();

day = date.getDay();  //returns 0-6

number = date.getDate();  //returns 1-31

month = date.getMonth();  //returns 0-11

year = date.GetFullYear();  //returns 2000

WP_000388 (1)

Operating System Detection

if (navigator.appVersion.indexOf(“Mac”) != –1

if (navigator.appVersion.indexOf(“Win”) != –1

if (navigator.appVersion.indexOf(“X11”) != -1

if (navigator.appVersion.indexOf(“Linux”) != –1

WP_000385 (1)

Referencing <IMG> inside a <DIV> in NN 4.7 et. al.

Each <IMG> must have a unique name.

<IMG NAME=”imgName” src=”img.gif”>

IE 4.0+, NN 6.0     document.imgName.src

NN 4.7                   document.divName.document.imgName.src

WP_000382 (1)

Underscores in <DIV> names

Netscape 4.7 does not allow this.  Instead of “this_container,” use “thisContainer” or some other variation.

Summary

I recall having aspirations of putting a published book together with all of these tips. Here’s a few observations I made about ME as a developer 12 years ago.

1) I had absolutely no business being employed as a software developer.

2) Browser compatibility, for all we complain about it, is nowhere near as bad as it was.

3) Apparently, I capitalized all of the tags and their property names in HTML.

4) When remembering Javascript, I apparently wasn’t too worried about semicolons.

5) I remember treating this book like Henry Jones Sr. treated his grail diary.  It held all of the secrets to unlocking the power of the web.

Do you have any silly old stuff like this laying around?  I’d love to hear your stories about old development practices you employed.

Published at DZone with permission of Jeff Blankenburg, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)