Re: Challenges on JavaScript Techniques

> > > Take PPK up on his offer.
> >
> > For what it's worth: Definitely agreed.
> For me it's ok ;)

Thanks for the confidence. Please note that this is not my
highest-priority project at the moment, so it may take a week or so
before I can actually show something.

A few questions and remarks:


I assume that the target audience of the document is web developers.
If I'm wrong, please correct me.


If the document is targeted at web developers, I'd like to use a few
best practices, like separation of behaviour and structure, that,
while not themselves required for accessibility, nonetheless will make
sure that the document fits into current web development discussions.


Separation of behaviour and structure means

WRONG: <form action="somewhere.php" onsumbit="return validate()">

RIGHT: <form action="somewhere.php" id="validate">

window.onload = function () {
   document.getElementById('validate').onsubmit = validate;


2.2 Dynamic content generation

"Assistive technologies such as screen readers rely on the Document
Object Model (DOM) to interpret the semantics in HTML for a different
modality. Given this, the document.write() and innerHTML() methods can
render content invalid (and inaccessible via DOM) after the fact."

The real problem is that browsers will attempt to construct a valid
DOM, but will arrive at different structures.

I'm also not sure if innerHTML should be deprecated per se; especially
when generating large blocks of content it's faster than W3C DOM
methods (see benchmark


2.4 Device-independent events

This of course belongs in the document, though maybe not under the
Links header, but we'll need quite a bit of research before being able
to recommend proper event pairs (click/keypress etc.). The current
example is incorrect: onactivate is supported only by Explorer (Win
and Mac).


2.6 Dynamic HTML menus

I've got a perfect example for this point, though I have to rewrite
it, and it may become quite large, since it needs carefully
orchestrated XHTML, CSS, and JavaScript to get the point across.

Am I allowed to create separate documents with large code examples?


New point: Inserting asynchronously loaded content (AJAX). Am I
allowed to add points to the document? I expect to think of some more
points when I'm working on the document.

ppk, freelance web developer

Received on Monday, 11 July 2005 17:24:58 UTC