[Javascript] get link to execute script rather than load page

Jeff Howden jeff at c4webdesign.com
Thu Feb 7 01:29:39 CST 2002


lau,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Lau
>
> Thanks for the great article!
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

you're welcome.  it honestly wasn't specifically for you, but your post was
the impetus for me getting off my lazy butt and finally writing it.  *grin*

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> You have caused me to think seriously about
> non-javascript users.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

good -- that was the intended response.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> Can you tell me what sort of browsers/users do not have
> javascript enabled?
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

that's sort of a difficult question to answer.  simply put, any browser can
have javascript disabled by the user.  there are other browsers, granted
less common now, that don't have javascript support.  more importantly,
there are many browsers that don't support some of the more complicated
things that can be done with javascript.  take the example i mentioned in
the article about dhtml.  some of the users encountering your app may have
javascript support, but not to the level you require for your dhtml
functionality.  in this case, you almost need to treat them as if they don't
have any support for javascript.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> Do webtv browsers have javascript?
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

yes, but not all functionality.  probably the most common thing you'll use
that doesn't work on webtv is opening new windows.  webtv doesn't support
the idea of multiple windows.  consequently, when it encounters a link with
a target attribute or javascript that opens a new window, it simply follows
the link to the new window, replacing the document that created the window
to begin with.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> Roughly what percentage of browsers/users don't have
> javascript enabled?  (I'm designing my site for Netscape
> 4.0 and IE 4.0 and above because I thought the
> percentage of users using older browsers was pretty
> small.)
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

never go an assumption.  if you have server logs, generate a report based on
them that tells you about browser usage for your site.  then, you can make
an informed decision.

however, there's no definitive way to know what percentage of your users
don't have javascript support.  you're better off assuming they all don't
have javascript support and building your app to work for them with that
assumption.  then, once you get that working, go back and add enhancements
via javascript to make the process more efficient for those with javascript
enabled or with javascript that supports the objects and methods you're
intending to use.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> Are there any government regulations that require
> government web sites to be non-javascript capable?
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

yes -- section 508 of the workforce investment act of 1998.

Accessibility: more than the right thing to do
http://evolt.org/article/javascript/4090/381/index.html

Accessibility: The Clock is Ticking
http://evolt.org/article/javascript/4090/485/index.html

section 508 deals directly with accessibility to the disabled, but if you
think about it, requiring javascript doesn't exactly make things easier for
them.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> Maybe you could write a follow on article on why I
> should bother to handle non-javascript browsers?
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

perhaps, but i'd wager the benefits are fairly obvious.  making your site
work for as many people as possible gives you good karma.  besides, it's not
like you have to remove javascript functionality.  you just have to use it
responsibly.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> In your article your wrote:
> > ><><><><><><><><><><><><><><><><><><><><><><><><><><><
> > If you're trying to submit a form from a link, stop,
> > go directly to jail, do not collect $200.00.  Besides
> > the numerous expected behaviors of forms that you're
> > breaking (we're talking about usability here) by not
> > using a submit button of some variety, you're
> > needlessly neutering the form for non-JavaScript
> > enabled users.
> > ><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
>
> I'm guilty of this behaviour. Apart from "neutering the form
> for non-JavaScript enabled users", what are the "numerous
> expected behaviors of forms" that this behaviour breaks?
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

well, how about having a submit button the user can click to submit the
form?  how about being able to tab from one element to the next, eventually
tabbing to the submit button and being able to press the "enter" key to
activate it and submit the form?  when i say submit button, that doesn't
mean you have to use one of the boring grey buttons either.  you can just as
easily use an image submit, if looks are important.

hope this helps,

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/






More information about the Javascript mailing list