Can any javaScript bod help me with this before my head explodes?

Soldato
Joined
17 Oct 2002
Posts
4,308
Location
Bristol
Basically I need to get the src and complete status of all images on a web page, I use selenium to pass and run the script in the browser, but that isn't really important only that the last thing in the script gets passed back to selenium (in this case my ',' delimited array of info).

This is what I have:

Code:
var my_window = this.browserbot.getCurrentWindow();
var iframe_count = (my_window.document.frames.length);
var image_complete = new Array();
for(var j=0; j<iframe_count; j++){
	var my_images = my_window.frames[j].document.images;;
	for(var i=0; i<my_images.length; i++){
		image_complete.push(my_images[i].src +\",\"+ my_images[i].complete);}}
image_complete;

But this will only get me all images in the base frames, I also need to get them from at least 1 level of nested frames.

At the moment I get all image info from:

my_window.frames[X].document.images

I need:

my_window.frames[X].frames[X].document.images

I just need another loop in there somewhere but my brain is hurting bad :(

Thank for any help
 
Last edited:
Back
Top Bottom