[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: call event with graphic?

You can't leave the HREF= out because then it's not a clickable link, and
HREF by itself is the same as an empty string  -- the problem wit that is
when the function returns you get a screen of the current directory.  You
dynamically reset the href, like this:

<A HREF="" onClick="this.href='JavaScript:set()'">

though this is functionally no different than 

<A HREF="JavaScript:set()">

-- Gordon

At 09:59 AM 3/7/96 -0800, you wrote:
>On Mar 6,  4:18pm, Gordon Mueller wrote:
>> How can you call a script with a HREF? I am trying to call the
>> script when a user clicks on a graphic. Using a form would be fine,
>> but I didn't find a way to get JavaScript to use its handlers on an
>> image. Any ideas?
>Right now, I just add an onClick= directive to the HREF tag, and have the HREF
>point to a dummy frame in my window . . .
><A HREF="title.html" TARGET="Win_Title" onClick="javaScript() ; return true">
>where Win_Title is a frame that always displays the small static page
>What I want to know is, can I just leave the HREF out?:
><A onClick="javaScript() ; return true"> 	or
><A HREF onClick="javaScript() ; return true">

For help about the list, please send a message to 'majordomo@obscure.org'
with the message body 'help'. To unsubscribe, send a message to
'majordomo@obscure.org' with the message body 'unsubscribe javascript'.
List archives and pointer to FAQ: http://www.obscure.org/javascript/