O'Reilly logo

JavaScript™ Phrasebook: Essential Code and Commands by Christian Wenz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 12. Embedded Media

HTML and JavaScript are a killer combination, but sometimes more is required to create a modern web application. Therefore, HTML enables web developers to integrate other content in a site; generally, you need a browser plug-in for that. This chapter shows how to access this content and gives a few pointers for the most widely used content types. Note that most phrases in this chapter do not come with code downloads.

Accessing Embedded Media

Example . 

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required