There's more to Web browsers than (X)HTML, CSS, and JavaScript. ActiveX, plug-ins, and other embedded objects help make the Web what it is today. Get the scoop on these and more in this chapter excerpt from JavaScript: The Complete Reference, second edition, by Thomas Powell and Fritz Schneider McGraw-Hill/Osborne, ISBN 0072253576.
JavaScript and Embedded Objects - Cross-Browser Inclusion of Embedded Objects (Page 13 of 15 )
By far the best way to ensure the cross-browser compatibility of your pages is to use a combination of ActiveX controls and plug-in syntax. To accomplish this, use an <object> intended for IE/Windows ActiveX controls and include within it an <embed> intended for Netscape and IE/Macintosh plug-ins. The technique is illustrated in the following example:
<embed src="http://www.javascriptref.com/examples/ch18/flash.swf" width"318" height="252" play="true" loop="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"> <noembed> Error: No Object or Embed Support </noembed> </embed>
</object>
Browsers that do not understand <object> will see the <embed>, whereas browsers capable of processing <object> will ignore the enclosed <embed>. Using <object> and <embed> in concert maximizes the possibility that the user will be able to process your content.
This chapter is from JavaScript: The Complete Reference, second edition, by Thomas Powell and Fritz Schneider, McGraw-Hill/Osborne, ISBN: 0072253576). Check it out at your favorite bookstore today.