HTML and CSS Reference
In-Depth Information
individually manipulate an image with JavaScript if it is not named or
doesn't have an associated id .
The other three attributes let you provide some special JavaScript event
handlers. The value of each attribute is a chunk of JavaScript code, en-
closed in quotation marks; it may consist of one or more JavaScript ex-
pressions, separated by semicolons.
The popular browsers invoke the onAbort event handler if the user stops
loading an image, usually by clicking the browser's Stop button. You
might, for instance, use an onAbort message to warn users if they stop
loading some essential image, such as an image map (see section 6.5 ):
<img src="pics/kumquat.gif" usemap="#map1"
onAbort="window.alert('Caution: This image contains important hyperlinks.
Please load the entire image.')">
The onError attribute is invoked if some error occurs during the loading
of the image, but not for a missing image or one that the user chose to
stop loading. Presumably, the applet could attempt to recover from the
error or load a different image in its place.
The currently popular browsers execute the JavaScript code associated
with the <img> tag's onLoad attribute right after the browser successfully
loads and displays the image.
See section 12.3.3 for more information about JavaScript and event
handlers.
5.2.6.17. Combining <img> attributes
You may combine any of the various standard and extension attributes
for images where and when they make sense. The order for inclusion
of multiple attributes in the <img> tag is not important, either. Just be
careful not to use redundant attributes, or you won't be able to predict
the outcome.
 
Search WWH ::




Custom Search