Unobtrusive DOM Scripting
This manifesto from the Web Standards Project is right on the money in its technical recommendations -- that JavaScript should be linked to HTML only through a <script> tag, and not through embedded code. Still, reading through the manifesto, I couldn't help thinking it was mixing a technical argument for separation of responsibility with a cultural argument against JavaScript prejudices and a design argument against obtrusive JavaScript effects. It seems to me these are three separate things, and, as the authors argue for JavaScript code, they should be in separate documents.
tags:
| comments: 6
| Sphere It
submit:
0 TrackBacks
TrackBack URL for this entry: http://blogs.oreilly.com/cgi-bin/mt/mt-t.cgi/4200
Comments: 6
I was also confused when reading that document, thanks for validating my reality, Marc.... ;-)
(I try to make summary sentences, and then summary paragraphs, when presented with more than a screenful of text. Sometimes I'm not able to do that with any assurance that I'm accurately distilling the author's words into a more accessible format. This was one of those cases for me too, although you got that "keep JS separate!" admonition I missed. Has the unnamed author(s) confirmed your understanding of that being the key point they wanted to present?)
jd
John, no, I was just looking at the text; I haven't contacted the author. I wanted to like the whole piece, so I read it through a couple of times. I think all of their points are reasonable, but the source-level meaning of "unobtrusive" was the one I wanted to highlight.
Marc - consider us contacted. ;-)
The main author of the manifesto was PPK, although all of us Task Force members got a chance to put our two cents in.
Looking at the big picture, I can't say that I disagree with your point, and in the long term, we may well break it down into multiple docs. But for the announcement, we needed one single statement that we could point people towards.
Keep an eye on the DOM Scripting Task Force blog -- we've got lots of ideas for the future.
Dori
DOM Scripting Task Force co-leader
Dori, thanks for the note. I'll be interested to see how it goes. I think you're arguing for good purposes.
Its called the "Decorater Pattern" and when used can be effective (Macromedia also calls in the Mix-In).
Its how the world of JS should be... for it is wise.
Post A Comment:
STAY CONNECTED
RECENT COMMENTS
- Scott Barnes on Unobtrusive DOM Scripting: Its called the "Decorat...
- Marc Hedlund on Unobtrusive DOM Scripting: Dori, thanks for the no...
- Dori on Unobtrusive DOM Scripting: Marc - consider us cont...
- Marc Hedlund on Unobtrusive DOM Scripting: John, no, I was just lo...
- John Dowdell on Unobtrusive DOM Scripting: I was also confused whe...
- Josh Peters on Unobtrusive DOM Scripting: Heck yeah! Working in ...
Josh Peters [07.20.05 12:25 PM]
Heck yeah!
Working in education has especially taught me just how important seperating javascript from a document is. I've found that not depending on client-side scripting for anything makes for accessible documents, while adding dom scripting after the fact can really enhance the document/application without discriminating. My rule is not to let the client do anything the server cannot do.
As people move closer to actually using xhtml for xml applications, this only gets more important, as one should not need to depend on the user agent (browser, bot, or whatever) to be able to parse javascript in order to use a resource.