is there a way to count how many flash objects are embeded on a webpage?

Discussion in 'JavaScript' started by gigigi, Apr 29, 2008.

  1. #1
    simple question: is there some way to get the number of flash objects currently present on a page via javascript? some DOM function maybe? or any other way..

    thanks!
    gigi
     
    gigigi, Apr 29, 2008 IP
  2. ToddMicheau

    ToddMicheau Active Member

    Messages:
    183
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    58
    #2
    Simple bit of JS here for you, if you use the <object> tag to embed you will have to edit the code.

    
    function countFlash(){
        var flashArray = document.getElementsByTagName("EMBED");
        alert(flashArray.length); 
    }
    
    Code (markup):
    n_n
     
    ToddMicheau, Apr 30, 2008 IP
  3. gigigi

    gigigi Member

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #3
    looks good, thanks a lot!
     
    gigigi, Apr 30, 2008 IP