Forum Moderators: open

Message Too Old, No Replies

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

         

gigi

10:57 pm on Apr 29, 2008 (gmt 0)

10+ Year Member



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

niralsoni

11:00 am on Apr 30, 2008 (gmt 0)

10+ Year Member



may be this can help you...

var obj = document.getElementsByTagName("object");
alert("No of Embeeded Objects = " + obj.length);

/*
"getElementsByTagName" method gives the references to the no. of occurances of tagname specified in the parameter.

this may work in case your site contains only flash objects

or else you have to render this through a loop and identify the type of object it is.

*/

gigi

10:55 pm on Apr 30, 2008 (gmt 0)

10+ Year Member



looks good, thanks for that!