Accessing Embedded Media


document.media 

The "official" HTML element to embed media is <object>. However, to have a cross-browser site, usually an <embed> object is embedded within the <object> element. To make accessing the embedded object as easy as possible, the <object> element's id attribute should match the <embed> object's name attribute:

<object class >   <embed name="media"></embed> </object> 


Then, you can access the embedded media using the shortcut from the beginning of this phrase. Of course, you could also use document.getElementById() to access the <object> element; all <embed> elements reside in the document.embeds array. As you can see, the shortcut is much more convenient here.




JavaScript Phrasebook(c) Essential Code and Commands
JavaScript Phrasebook
ISBN: 0672328801
EAN: 2147483647
Year: 2006
Pages: 178

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net