Just Another Blog

Are you thinking what I'm thinking?

Saturday, July 10, 2004

Please extend the web correctly

Dave Hyatt is an open person who listens to comments. But unfortunately he seems to misunderstood the suggestions.

On his previous blog post, he mentioned 2 ways to extend the (X)HTML:

  • Namespace mechanism
  • New DOCTYPE declaration
He now proposes to use namespace mechanism in HTML, which is not correct.

There is no namespace in HTML. It is the X(HT)ML stuff. DOCTYPE is, however, available to both HTML and XHTML. Eric Meyer has made a very good example illustrating this. As you can see, the example is written using the old-school HTML.

Another benefit is that if the web browser doesn't support this DOCTYPE, it can choose not to render it at all (or handle it with special care). After all, those new elements and attritubes are used in the Dashboard only, isn't it? So webpage will those new stuffs are useless in other browsers anyway...

If the Dashboard is going to stick with HTML in its first release, it should use the HTML way of extending the web. Developers can add the (real) namespace mechanism later when Safari has better (and real) support of XHTML.

P.S. Lachlan Hunt made another cool suggestion: use the generic <object> element (wow, my favorite). This element might be new to you, but it exists in both HTML and XHTML. Let me modify Eric's example a little bit...

In blah.html:

<style type="text/css">
body {background: aquamarine;}
<script type="text/javascript">

function startup() {
  alert('Happy!  Joy!');
<body onload="startup();">
<object type="application/dashboard+xml" data="blah.dashboard">
  Your browser doesn't support dashboard...
<div class="main">
<p>So cool.</p>

<p>So fine.</p>
<img src="yar.gif" composite="punchout" alt="Yar!">
<p id="footer">copyleft nobody</p>

In blah.dashboard (an XML with content-type of "application/dashboard+xml"):

  <blah>A blah element/blah>

Browser that doesn't support the Dashboard object will then simply display "Your browser doesn't support dashboard...", while other (X)HTML contents are still visible.


Note that troll and spam comments will be deleted without any notification.

Post a Comment

<< Home