View Full Version : need to obtain variable number of iFrames in a page

07-06-2007, 03:28 AM
I have a page that is going to have x number of iFrames. document.iFrame has no properties, so I can't check the length and without knowing how many iframes there are going to be, I can't loop through the elements by ID.

Basically, what I'm trying to do, is prevent a user from clicking on a link that displays a hidden <div> until all iframes are loaded. If the link is clicked before the iframe loads, the iframe stops loading (this is only affecting IE, but my Company mandates the IE is the standard :mad: ).

Any other ideas on how to fix this would be helpful

07-06-2007, 05:44 AM
You could use getElementsByTagName:
var ifm = document.getElementsByTagName('iframe');