Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2007
    Location
    VA
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    need to obtain variable number of iFrames in a page

    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 ).

    Any other ideas on how to fix this would be helpful

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Posts
    679
    Thanks
    0
    Thanked 16 Times in 15 Posts
    You could use getElementsByTagName:
    Code:
    var ifm = document.getElementsByTagName('iframe');
    alert(ifm.length);


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •