spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / programming / javascript / netscape6 / test

Onload Test Cases

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

Some newer browsers do not behave identically to older DHTML-capable browsers when loading external JavaScript files, especially when dynamically written. What follows is a series of simplified test cases designed to test whether browsers successfully load and execute external files.

External JavaScripts in HEAD

window.onload example 1
external script using SCRIPT SRC, onload assigned in BODY tag (works as expected)
window.onload example 2
external script using document.write SCRIPT SRC. onload handler contained within same SCRIPT block. (doesn't work in NS6/IE5)
window.onload example 3
external script using document.write SCRIPT SRC. onload handler specified outside script block. (works in NS6/IE5)

External JavaScripts in BODY

window.onload example 4
external script using document.write SCRIPT SRC. onload handler outside SCRIPT block. (see 3)
window.onload example 5
external script using document.write SCRIPT SRC. onload handler assigned inside external file.

External JavaScripts that Reference HTML Elements

Flipper example 6
external script using document.write SCRIPT SRC. Original news flipper code (executable outside onload function). (see 3)
Flipper example 7
external script using document.write SCRIPT SRC. News flipper with executable inside onload function.
Flipper example 8
external script using document.write SCRIPT SRC. News flipper with executable inside onload function, onload handler assigned inside external file.

One remaining conundrum is in JavaScript.com's scroller related to dynamically writing external files. When we doc.write both the headlines and scroller code in the head it works fine in NS6, but when we move the doc.write of the scroller code to the end of the body it doesn't. We'll continue to investigate this, let me know if you have any suggestions. For now we're SSIng the scoller code at the end of the body for speed.

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business

 



Created: Feb. 19, 2001
Revised: Mar. 2, 2001

URL: http://www.webreference.com/programming/javascript/netscape6/test/