For the past year I’ve been following the progress of HTML5 with interest. And recently I’ve become interested in MIT’s Scratch. So naturally I’ve been test embedding Scratch using it’s Java applet in HTML5. The only article I’ve found so far on embedding Scratch in HTML5 contains a number of errors and invalid markup, so I’m setting the record straight.
First, the situation in HTML 4.01/XHTML 1.0 –
<object> is the preferred element, with
<applet> is valid in HTML 4 Loose (XHTML 1.0 Transitional), but not HTML 4 Strict.
Example embed for HTML 4.01:
In HTML5, the
<applet> element is obsolete, not deprecated.
So, we use the generic
<object> element. Also, we need an alternative to
the archive, code and codebase attributes. It took me a while to work out the solution,
with the help of the W3C validator – we can use the
Now, the HTML5 code:
Drum Kit 2.0, by technoguy.
Your browser needs Java enabled to view projects.