1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Frameset//EN"
2 "http://www.w3.org/TR/html4/frameset.dtd">
5 <TITLE>Test onunload and onload events for body-type document
</TITLE>
7 if (window.layoutTestController)
8 layoutTestController.dumpAsText();
10 function removeElementById(victimID)
12 vic = document.getElementById(victimID);
14 alert(
"not found : " + victimID);
18 vic.parentNode.removeChild(vic);
20 function boldCaption(captionID)
22 cap = document.getElementById(captionID);
24 alert(
"not found : " + captionID);
28 cap.setAttribute('style','font-weight:bold;');
29 cap.innerText +=
" - fired";
34 <BODY id=
"myBody" onload=
"removeElementById('myImage'); removeElementById('myObject'); removeElementById('myIFrame');"">
35 <P><U>Any lines that are bold and say "- fired
" correspond to event handlers that fired. Only the iframe onload event should fire in this test case.</U></P>
36 <P id="loadIMAGE
">IMG onloadEvent</P>
37 <P id="loadOBJECT
">OBJECT onloadEvent</P>
38 <P id="loadIFRAME
">IFRAME onloadEvent</P>
39 <P id="unloadIMAGE
">IMG onunloadEvent</P>
40 <P id="unloadOBJECT
">OBJECT onunloadEvent</P>
41 <P id="unloadIFRAME
">IFRAME onunloadEvent</P>
42 <IMG id="myImage
" onload="boldCaption('loadIMAGE')
" onunload="boldCaption('unloadIMAGE')
" width="40" height="40"></IMG>
43 <OBJECT id="myObject
" onload="boldCaption('loadOBJECT')
" onunload="boldCaption('unloadOBJECT')
">Apple</OBJECT>
44 <IFRAME id="myIFrame
" src="about:blank
" onload="boldCaption('loadIFRAME')
" onunload="boldCaption('unloadIFRAME')
" style="border-style:solid; border-color:red;
"></IFRAME>