View Full Version : document.images[i]

06-15-2003, 04:06 PM
Hello there agian! document.images[i] returns an array of all the images in the document right! Well this this leads to my questions! Does it return all the images in the document including thoughs in frames! Because I cant figure out how to reference frame then ask for images array!!

06-15-2003, 06:41 PM

Mr J
06-15-2003, 06:44 PM
document.images.length will return the number of images in the document.

This does not include images in other documents loaded into another frame

In order to target another frame you use


where main is the name of the frame

So to reference the second image in another frame so would go


06-16-2003, 12:31 AM
for some reason that doesn't work it returns a value of 0 but there are 24 images in that frame? And when I call specific image in the array it returns undefined? Could it be because I am using an iframe or am I just scripting challenged!

06-16-2003, 01:44 AM
try referencing the frame from the top. I usually do it this way.


06-16-2003, 05:31 AM
Maybe that frame uses frames....

Mr J
06-16-2003, 03:48 PM
Here are three senarios

In the page


In the page containing an Iframe


From another frame in a frameset where a frame contains an Iframe


The timeouts are to allow the page containing the images to load

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum