E-mail List Archives

RE: best way to use <a href> and javascript?

for

From: Ian.Lloyd@nationwide.co.uk
Date: Oct 30, 2002 3:47AM


-----BEGIN PGP SIGNED MESSAGE-----

********************************************************************
The contents of this email are intended exclusively for the
addressee. If you are not the addressee you must not read
use or disclose the email contents ; you should notify us
immediately [ by clicking "Reply" ] and delete this email.

Nationwide monitors e-mails to ensure its systems operate
effectively and to minimise the risk of viruses. Whilst it has
taken reasonable steps to scan this email, it does not
accept liability for any virus that may be contained in it.
********************************************************************

I have written some guidelines on this very topic, which I have pasted in a
raw format at the very bottom of this note. NB - the pop-up function is not
included, but you get the idea.

Hope this helps

Ian Lloyd, Electronic Channels
Nationwide Building Society

e-mail: <EMAIL REMOVED>
tel: 01793-655260
fax: 01793-656368


- -----Original Message-----
From: <EMAIL REMOVED>
[mailto: <EMAIL REMOVED> ]
Sent: 29 October 2002 12:13
To: <EMAIL REMOVED>
Subject: best way to use <a href> and javascript?


Hi all, I was looking for view opinions on this one.
Ive seen before in lots of lists not to use <a href="javascript:function
();">read notes</a> for the reason that screenreaders will read out the
javascript function when they execute the link.
An example often given to fix this is <a href="page.html" onClick
="window.open('page.html');">read notes</a>.
What if you are not linking to a new page though. What if your script is
for rewriting the content of a div.
What can you put in the href if you want to use the onClick method?
Ive used <a href="#" onClick="function();">read notes</a>
Jaws reads this as "link same page read notes" which I know is not good
enough.
How are people getting around this one, Id appreciate any thoughts,
Thanks Kieran

****************************************************************************
**********************
The contents of this email and any attachments are confidential.
It is intended for the named recipient(s) only.
If you have received this email in error please notify the system manager or
the sender immediately and do not disclose the contents to any one or make
copies.

** eSafe scanned this email for viruses, vandals and malicious content **
****************************************************************************
**********************


- ----
To subscribe, unsubscribe, or view list archives, visit
http://www.webaim.org/discussion/


- --------------------------------------------------------

Introduction
The pop-up window may be convenient for presenting information in a slightly
different way from a standard web page. It also presents increased
accessibility problems because:

* it relies on the person browsing to have JavaScript enabled
* it forces a change of window which may be jarring for someone who perhaps
cannot see the window and relies on being told that the window is a new one

However, despite this, there are techniques to make pop-up windows more
accessible.

Accessibility tips

To ensure your pop-ups are accessible, do the following:

* Pre-warn if a window is launched in a pop-up - this could be either in
body text or in a title attribute of the launcher link, e.g <a href="..."
onClick="..." title="Launch the mortgage quote in a pop-up window">
* Be mindful of what options are available in the pop-up, for example, are
you removing the menu bar and toolbar, thus making it more difficult to
print? Just something to consider.
* Do not rely on the browser to be script-enabled. This means taking a
two-track approach in which you:
* use a simple href
* call the JavaScript function in an onClick event
* use 'return false' to cancel the default action of the href
* use a target window - this is also cancelled out by the return false
<a
href="testpage.htm" - for accessibility
target="popUpWin" - for accessibility
onclick="popUpWin('testpage.htm','standard',300,300); - for script enabled
browsers
return false; - for script enabled (cancels out first two accessibility
parts)
">Open Pop-up</a>


-----BEGIN PGP SIGNATURE-----
Version: PGPsdk version 1.1.1 (C) 1997 Pretty Good Privacy, Inc.

iQEVAwUBPb+0024wJNdvwuyFAQHPZQf/X72Tuh1jrgtIAOLq2uk7ZgeJ7S/PtcrF
Ycm3DcWFc0CBcQmbdgrXbQDeaU9jYosAG1Xrrfgn9XYmim4eZ30ZMB8Syi8piBea
K/cg+V2ZWsnKEapy5U+kkB2K/xoJGPWsB6NteanQXFXW8RrWMysSchBWnN6KNYBY
7oKnt2WSj4um27/xMeRzT/VclWUjI/OUNx4q9KqQbcn3cWZTa7yf/FLKcF3RWMsQ
I1oljcJM/WKWuT2nueNGAinTWmoULzVl8jtyyKeJLTcrXMK7dLOQlm31kVaXLiBO
9EvxNuVXnCcszM9jZMZAoG0kFOvHgd6ulogxxGRpxCwcARTTgsXgRg==
=xNHI
-----END PGP SIGNATURE-----


----
To subscribe, unsubscribe, or view list archives,
visit http://www.webaim.org/discussion/