Using the Object Tag

The newest version of HTML, HTML5, has replaced the <applet> tag with an <object> tag for loading Java applets, Flash programs, and other forms of interactive content. This tag has height and width attributes just like <applet>. There’s also a type attribute that must be “application/x-java-applet”, the designated MIME type of Java applets. (MIME types categorize file formats that can be delivered over the Internet.) Here’s the start to the formatting of an object:

<object type="application/x-java-applet" height="300" width="400"></object>

The code and codebase of an applet are not designated as attributes. Instead, parameters named code and codebase are placed within the opening <object> tag and closing </object> tag.

Get Sams Teach Yourself Java™ in 24 Hours, Sixth Edition 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.