Every image in the document corresponds to an element in this array. There is a one for one relationship between these elements and <IMG> tags.
The MSIE and Netscape browsers each maintain an ImageArray object which is just a special case of the Array object. However, although they both store objects that represent images in that array, those image objects are quite different. For a start in Netscape they are of the class "Image" while in MSIE they are of the class "IMG" named after the HTML tag. Perhaps this is fortunate in that you may be able to detect what kind of object you are operating on if you need to perform complex image management activities. This might change however if browsers become more standards compliant in their object class naming, so it may not be true of all versions of all browsers.
The DOM level 1 specification requires that only those images referenced by <IMG> HTML tags should be included in this list.
Be aware that if you are not using some NAME or ID binding to the <IMG> tags, you may get unexpected results if new images are added and you are accessing elements of this array using numeric index values.
See also: | Document object, Element.all[], Image object, ImageArray object |
Prev | Home | Next |
Document.ids[] | Up | Document.implementation |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |