Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<IMG> QUESTION? 1

Status
Not open for further replies.

sreeky

Programmer
Aug 8, 2001
77
US
i have an image and the only thing i am trying to do is if i click on that image it has to call a function. the function has a window.open command to open a new window.
i don't want <a href>
this doesn't work........any solution?

 
try this....
<img src=&quot;mysrc.gif&quot; onClick=&quot;myfunction();&quot;>
 
i have used this code all the while and tested in netscape!! and thought there is some thing wrong with the code!! finally when i tried in IE it worked.
thanks!!

works only in IE 5.5 not in Netscape4.5...........!! any other way??
 
Why can't you just use
Code:
<a href=&quot;#&quot; onClick=&quot;myfunction()&quot;><img src=&quot;mysrc.gif&quot;></a>
?

Netscape 4.x does not process mouse event-handling for anything else besides form elements and hyperlinks, sorry.
 
by giving href would reload the existing page.......it also opens a new window which i want but i dont want reloading the existing page!!
can we avoid using this or any work around???
 
do:

Code:
<a href=&quot;#&quot; onClick=&quot;myfunction(); return false;&quot;><img src=&quot;mysrc.gif&quot;></a>

- that way it won't reload the page when you click the image
- there is NO way to make it work on NS without the
Code:
<a>
tag
 
Why use:
&quot;<a href=&quot;#&quot; onClick=&quot;myfunction(); return false;&quot;><img src=&quot;mysrc.gif&quot;></a>&quot;
and not
<a href=&quot;JavaScript:myfunction()&quot;><img src=&quot;mysrc.gif&quot;></a> My codes look like something a kid wrote
I have absolutely no idea what I am talking about
Somehow I still manage to make it work
 
801119 is right, that way is usually easier, you dont have to type as much.

also, another hint: <a href=&quot;Javascript:myfunction()&quot;><img src=&quot;mysrc.gif&quot; border=0>

that will prevent the annoying link-colored border from popping up theEclipse
eclipse_web@hotmail.com
**\\||It was recently discovered that research causes cancer in rats||//**
 
hey, guyz
onmousedown/up will work perfectly in ie & netscrap:
<img src=&quot;mysrc.gif&quot; onmouseup=&quot;myfunction()&quot;>

at least i use it..
Victor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top