Re: [#1059] Prohibit URLs with javascript protocol

Michael wrote:
Links that use the Javascript protocol, e.g., 

  <a href="javascript:dosomething();">Javascript link</a>

are unusable by browsers that do not support JavaScript.

There should be a technique that advises authors not to use javascript 
links. Instead, they should provide an http link to a fallback page, and 
instantiate the desired script using event handlers. For example:

  <a href="fallback.html" onactivate="dosomething()">Good link</a>
end Michael quote

While I agree that hrefs that use the JavaScript protocol are unusable by 
browsers that do not support JavaScript,  I don't believe that is an 
accessibility issue but rather a usability issue.  As a web developer I 
should be able to make the decision of whether or not my site will run 
with JavaScript turned off or not.  I believe that if my site uses 
JavaScript AND it is accessible in a browser that supports JavaScript, it 
should pass WCAG 2.0 at level 1. 

One can argue that the web developer should always provide a fallback url 
and use the second technique (although you should use the onclick event 
rather than onactivate since the browsers implement onactivate very 
differently).  But could I work around this by having the fallback page 
state, "You must have a browser capable of JavaScript and have JavaScript 
support turned on to use this site"?  I don't believe that is what Michael 
intended but it could be a way to "work around" this requirement without 
making the site any more usable.  And, if I am required to create a 
working fallback page for each link, why even bother to use JavaScript at 
all as I have just doubled my amount of coding and have probably lost the 
benefits of using JavaScript in the first place? 

-becky

Becky Gibson
Web Accessibility Architect
                                                       
IBM Emerging Internet Technologies
5 Technology Park Drive
Westford, MA 01886
Voice: 978 399-6101; t/l 333-6101
Email: gibsonb@us.ibm.com

Received on Tuesday, 21 September 2004 21:11:24 UTC