Share via


ASP Best Practices

Next Topic

Using Object Statements with Embed Statements

To effectively deliver interactive objects to multiple browser types, write for browsers that do not support the HTML <OBJECT> tag.

To script the use of interactive objects, Microsoft ActiveX controls, or Java applets in HTML pages designed for a wide range of browsers:

  • Use the <OBJECT> tag to place the object on the page.

  • Add the <EMBED> tag for browsers that do not support the <OBJECT> tag.

  • Add a display object using the <NOEMBED> tag for browsers that cannot play the object.

The following example places a ShockWave control onto a page, and provides for the contingencies just mentioned.

<OBJECT ID="ShockedPMDauntless"
  CLASSID="clsid:59CCB4A0-727D-11CF-AC36-00AA00A47DD2"
  CODEBASE="https://fabrikam.microsoft.com/marketing/movers/"
  WIDTH=180 HEIGHT=120>
  <PARAM NAME="swURL" VALUE="dauntless.dcr">
  <EMBED SRC="dauntless.dcr" ALT="Movie of Fabrikam Dauntless model in action"
    WIDTH=180 HEIGHT=120>
  </EMBED>
  <NOEMBED>
  <IMG SRC="dauntless.gif" ALT="Picture of Fabrikam Dauntless model in action"
    WIDTH=180 HEIGHT=120>
  </NOEMBED>
</OBJECT>