469,950 Members | 2,107 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

wanted: workaround to javascript:show(...); instead of onClick forNetscare 4

I was calling a function in a js file from an image onClick event, but
someone still using Netscape 4 (!) complained that it didn't work. I
read that img onClick doesn't work in Netscape 4, so swithced it to
"javascript:show(...);" and the code works, but I read in this group
that it was not wise to do that, here's the working version, using the
not recommended approach:

<a href="javascript:show('art_2.jpg','600','448');" target="_self">

I'd appreciate any suggetions that will let me call the "show" function
from an onClick image event that will work in most IE/Netscape 4+ browsers.

TIA,
Mike
Jul 20 '05 #1
2 1343
Lee
mscir said:

I was calling a function in a js file from an image onClick event, but
someone still using Netscape 4 (!) complained that it didn't work. I
read that img onClick doesn't work in Netscape 4, so swithced it to
"javascript:show(...);" and the code works, but I read in this group
that it was not wise to do that, here's the working version, using the
not recommended approach:

<a href="javascript:show('art_2.jpg','600','448');" target="_self">

I'd appreciate any suggetions that will let me call the "show" function
from an onClick image event that will work in most IE/Netscape 4+ browsers.


<a href="#" onclick="show(...);return false"><img...></a>

By the way, it's not that "onclick doesn't work in Netscape 4",
it's just that way back then, images weren't considered things
that should react when clicked.

Jul 20 '05 #2


mscir wrote:

I'd appreciate any suggetions that will let me call the "show" function
from an onClick image event that will work in most IE/Netscape 4+ browsers.


<a href="#"
onclick="show(...); return false;"><img src="whatever.gif"
alt="whatever"></a>

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Jack | last post: by
7 posts views Thread by f1crazed | last post: by
2 posts views Thread by MOHSEN KASHANI | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.