[Javascript] shortcuts

David Dorward david at dorward.me.uk
Wed May 24 08:26:40 CDT 2006


On Wed, May 24, 2006 at 03:18:25PM +0200, Michael Borchers wrote:
> i want to offer a navigation via shotcuts.
> i did it this way so far:
> 
> <a href="#" onfocus="javascript:redirectByShortcut('<?php echo 
> CONTACTS_FILENAME; ?>?select=1');" accesskey="c"></a>
> 
> function:
> function redirectByShortcut(redirectUrl)
> {
> top.location.href = redirectUrl;
> }

Wouldn't it be rather easier and more reliable to just:

<a href="<?php echo CONTACTS_FILENAME; ?>?select=1" 
   target="_top" 
   accesskey="c">link text</a>

Accesskeys are generally considered harmful though - they tend to
conflict with built in browser shortcuts (remember that different
browsers have different shoutcuts - as do two instances of the SAME
browser in different languages, and the same browser with different
assistive technology installed).

-- 
David Dorward                                      http://dorward.me.uk




More information about the Javascript mailing list