Fwd: Re: [TECHS] Sample Scripting Techniques with baseline information (fwd)

I ran this posting--

<http://lists.w3.org/Archives/Public/w3c-wai-gl/2005AprJun/0767.html>

-- by Peter-Paul Koch <http://Quirksmode.org/>, who, along with 
Jeremy Keith <http://adactio.com/>, is a leading proponent of 
responsible JavaScript usage. He writes:

>Example 1:
>
>- JavaScript and CSS available and enabled
>
>>"With JavaScript, the onchange event can be used on each individual 
>>from control to validate the data as it is entered or changed.  A 
>>JavaScript alert can notify the user of the error.  CSS can be used 
>>to style the label for the input field to indicate the field in 
>>error. See the code example below. "
>
>Bad practice! Sure, this can be done, but it's better to
>
>a) check the form onsubmit, because the user wouldn't like to get 
>all sorts of alerts while he busy filling out a form
>
>b) not use alerts; it's far more user friendly to write the error 
>messages next to the form fields 
>(http://www.quirksmode.org/dom/error.html)
>
>Note that these are *usability* best practices.
>
>- JavaScript and CSS available but disabled
>
>There is no difference between this case and the HTML only case.
>
>>"In the example below if JavaScript is not available the onchange 
>>event will not fire and no client side validation will occur. "
>
>A bit overdone. If JavaScript is not available, nothing will happen 
>at all. Now it seems as if the script could run, if only it weren't 
>called from an event handler, which is of course nonsense.
>
>Example 2:
>
>Very cumbersome phrasing (what the hell are "delivery units"?), but 
>essentially correct. She basically says:
>
>>"If you extract the content of <link> tags by means of JavaScript, 
>>it won't work without JavaScript, and the task of doing this falls 
>>back to the user agent."
>
>True, of course, but hardly enlightening.
>
>The real question is: is the information in the link tags so 
>important that the page as a whole becomes inaccessible without it?
>
>BTW: My site uses this technique. The "up/down/previous/next/intro" 
>links at the bottom of a page are extracted from <link> elements in 
>the <head>. Go to any static content page to see them.
>
>-------------------------------------------------------------------
>ppk, freelance web developer
>http://www.quirksmode.org
>------------------------------------------------------------------


-- 

     Joe Clark | joeclark@joeclark.org
     Accessibility <http://joeclark.org/access/>
     Expect criticism if you top-post

Received on Monday, 20 June 2005 16:50:17 UTC