Image Event Handling
<HTML> <HEAD> <TITLE>Image Event Handling</TITLE> <SCRIPT LANGUAGE="JavaScript"><!-- function imageLoaded() { document.bgColor="#FFFFFF" alert(document.images[0].src+" has been loaded.") } function imageAborted() { alert("imageAborted") } function imageError() { alert("Error loading image!") } //--> </SCRIPT> </HEAD> <BODY> <H1>Image Event Handling</H1> <P>An image is loaded after this paragraph.</P> <IMG SRC="http://www.java2s.com/style/logo.png" onLoad="imageLoaded()" onAbort="imageAborted()" onError="imageError()"> </BODY> </HTML>