Scripting for NS6 and IE5.5 takes special care to adhere to standards and good programming practices. Each browser acts differently for external scripts, and you must be careful to encapsulate your element-dependent executable within functions called onload. Netscape 6 is particularly sensitive to improperly nested HTML when executing dynamically loaded scripts. By following these best coding practices, and coding for the DOM, you can ensure your scripts will work for current and future generations of browsers.
- Properly Nest all HTML Tags
- Properly Close all HTML Tags
- Validate your HTML
- Validate your CSS
- Choose the appropriate DOCTYPE, if any
- Define onload handers within external files, or subsequent SCRIPT blocks
We've provided some test cases to illustrate the problems that we discussed, and also some workarounds.
- Mozilla.org - Look for bugzilla
- Gecko Connection - Standards-based info and tutorials
- Loading External JS Files for DHTML Browsers - From DHTMLab
- Netscape 6 Part I: Detection & Scripting
- NS6 Scripting Info - Tutorials plus rated NS6/DOM links
- Scott Andrew - Excellent source for DOM-NS6 scripting info, with detailed tutorials
- Transitioning from Proprietary DOMs and Markup to W3C Standards - By Eric Krock
- W3C Spec's/Validation/Standards
# # #
About the author: Andrew B. King is the founder and Managing Editor of WebReference.com. He holds a BSME and MSME from the University of Michigan. He's been creating Web sites since 1993 and still can't find time for his own home page. He has written for Web Techniques, MacWEEK, and contributed to HTML and Web Publishing Secrets, by Jim Heid. Special thanks go to Dan Ragle of internet.com and Bob Clary of Netscape for their help in researching this article. Andy can be reached at email@example.com.
Created: February 15, 2001
Revised: Mar. 6, 2001