Samples of different methods of embedding plug-ins in HTML documents

Disclaimer: This is not an official anything, and may contiain mistakes.

This page uses Shockwave Flash for testing purposes.

Test 1. Using <embed> only

EMBED will never be standard because it is fundamentally incompatible with SGML and XHTML. But it is fairly reliable in practice.

HTML codeHow your browser handles it
<embed width=200 height=200
    src="sample1.swf" type="application/x-shockwave-flash"
    bgcolor="00ffff">

Test 2. Using <object>: The official standard way

Most people avoid this, for some reason. Possibly because it doesn't work in most browsers.

HTML codeHow your browser handles it
<object width=200 height=200 
  data="sample1.swf" type="application/x-shockwave-flash">
 <param name="bgcolor" value="00ffff">
   This is some alternate content that should only be
   displayed if your browser can't handle Flash.
</object>
This is some alternate content that should only be displayed if your browser can't handle Flash.

Test 3. Using <object>: The IE-only way

Note: "D27CDB6E-AE6D-11cf-96B8-444553540000" is the identifier of the Shockwave Flash ActiveX control.

HTML codeHow your browser handles it
<object width=200 height=200
  classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
 <param name="src" value="sample1.swf">
 <param name="bgcolor" value="00ffff">
</object>

Test 4. The traditional <object> and <embed> combination

This method appears to have been carefully designed to work around most of the bugs in popular browsers.

HTML codeHow your browser handles it
<object width=200 height=200
  classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
 <param name="src" value="sample1.swf">
 <param name="bgcolor" value="00ffff">

  <embed width=200 height=200
    src="sample1.swf" type="application/x-shockwave-flash"
    bgcolor="00ffff">

</object>
This page was made by Jason Summers.