Main Page

MIME Types

ActiveX Objects
— ActiveX objects are everywhere in Internet Explorer. You can use them from
JavaScript and you can embed them in Web pages. Although not technically a plugin, because
ActiveX support exists in Internet Explorer itself, ActiveX objects are embedded into a Web page
the same way as other plugins.
Macromedia Shockwave
— Before there was Flash, there was Shockwave. Shockwave plays
files created in Macromedia Director, a multimedia programming environment allowing devel-
opers to create interactive demos, games, and other advanced content. Although not as popular
since Flash gained notoriety, Shockwave is still available on both Windows and MacOS.
MIME Types
When talking about plugins, the concept of MIME types is central. MIME stands for Multipurpose
Internet Mail Extension, a simple text string originally designed to determine the format of e-mail
attachments. From that humble beginning, MIME types (also called content types) have grown into the
de facto standard for identifying file formats on the Internet.
Each MIME type is made up of a media type and a subtype. The media type can be application, image,
audio, video, text, message, model, and multipart. The subtype is typically a more unique identifier,
specifying anything from the type of compression scheme used to the file extension. The media type
and subtype are separated by a forward-slash (/), such as
, which tells the browser (or other
Internet application) that the file is plain text and is also a CSS style sheet. Browser plugins work by
mapping themselves to specific MIME types, telling the browser that when this specific type of file has
to be handled, it should be done by the plugin.
Naturally, several MIME types are handled by the browser itself, such as
(CSS style sheets),
(GIF-encoded images),
(XML files), and
(HTML files). Many others, however, are handled by
Embedding Plugins
To embed a plugin into a Web page, HTML offers the
element. At the very least,
requires four attributes:
— The MIME type of the file or object being embedded
— The URL of a file to load into the object
— The horizontal space the object should take up in the page
— The vertical space the object should take up in the page
The browser internally equates the MIME type of a file with a particular plugin, so setting the
attribute is enough to tell the browser which plugin to load. For example, the content type for a Flash file
, so the following code is all you need to embed a Flash movie:
<object type=”application/x-shockwave-flash” data=”myflashmovie.swf”
width=”100” height=”100”></object>
Interacting with Plugins
21_579088 ch18.qxd 3/28/05 11:43 AM Page 533

JavaScript EditorFree JavaScript Editor     Ajax Editor