10.6. Support for Older, Netscape Browsers

Older, Netscape-based browsers do not support the <object> tag. If you need to include support for these browsers, you have only one choice—use the <embed> tag. However, you shouldn't use only the <embed> tag; some newer browsers do not support it. Using both tags is also problematic; some user agents support both tags, resulting in the object data being embedded twice in the document.

The answer is to include an appropriate <embed> tag within the <object> tag. Newer browsers will ignore the <embed> tag because it doesn't belong within the <object> tag, while older browsers will ignore the <object> and <param> tags but will process the <embed> tag.

For example, to use <embed> with the earlier Flash example, you would use code similar to the following:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#versi
on=6,0,40,0" width="150" height="150">
  Radar Screen
  <param name="movie" value="radar.swf" />
  <param name="quality" value="high" />
  <param name="loop" value="1" />
  <param name="play" value="1" />
  <EMBED src="radar.swf" quality="high" width="150" height="150"
    type="application/x-shockwave-flash"
    pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

Placing the <embed> tag within the <object> tag will cause newer user agents to ignore it; they will perceive it as an invalid part of the <object> block due to its context. Older user ...

Get Web Standards Programmer's Reference: HTML, CSS, JavaScript®, Perl, Python®, and PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.