Moving to HTML 5
August 13th, 2009
Today I’m making the grand leap of moving, where possible (i.e., when I have time … ha!), over to HTML 5. The future is now.
I was pushed over the edge when I peaked at the code for John Resig’s site. I looked again at the differences between HTML 5 and HTML 4. I looked again at how HTML 5 differs from XHTML. I looked again at the vexing problem of application/xhtml+xml.
And then I looked at an example HTML 5 document:
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Example document</title>
</head>
<body>
<p>Example paragraph</p>
</body>
</html>
The clouds parted and a Voice said, “Move, little one. Move.”
Looking at Resig’s code, has the charset declared as <meta http-equiv="content-type" content="text/html;charset=utf-8"/>. The draft says:
Using a meta element with a charset attribute that specifies the encoding as the first element child of the head element. could be used to specify the UTF-8 encoding. This replaces the need for
I ain’t picking on Resig, honest. I follow his lead and I think it’s useful (understatement) to compare his work to what the WHATWG suggests. I’d be curious to know, then, (if he hasn’t already blogged about it), why he retained use of the previous charset declaration. Well, for starters I could guess: it doesn’t harm anything.
Other great ironies: the HTML 5 spec page uses an HTML 4 doctype as does the HTML 5 and 4 differences page. I suppose they’re sticking to W3C recommendations until the HTML 5 draft becomes a recommendation.
And who else is on board? Google (peak at their code). Apple. Microsoft.