Reputation: 25359
I want to find all flash objects on a random page (to make them wmode=transparent so they wont hide a menu).
IE does not support EMBED in: document.getElementsByTagName("EMBED");
Any idea what is the most efficent to find all embeds (no jQuery...)
Also for the more advanced: I came across sites where the embed tag was written as eMBED. I need to find these kind of tags also.
Thanks
Upvotes: 1
Views: 815
Reputation: 10974
I think the problem is not that IE does not support a search on <embed> tags but rather that in IE one uses <object> tags to include a flash element. As a matter of fact, Firefox also supports the latter format, if you use the following form:
<object type="application/x-shockwave-flash" data="MyFlashProgram.swf">
In fact, this is the preferred syntax, and swfobject uses this as well. So, for a cross-browser solution, you'd need to look for:
type
attribute set to "application/x-shockwave-flash"classid
attribute set to "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"Im unsure about other browsers like Opera or Safari, it is possible that you need to extend this list with further variants.
Finding these elements should be trivial with a javascript library like jQuery or prototype, but you can manage without those.
Upvotes: 2