Re: events and image



amit said the following on 6/29/2006 4:36 PM:
Hi group,

Long story short, I'm new to JavaScript and have started it less than 3
weeks. My question is

1) how can I create a situation that when user clicks on gif or ...
image file an event get triggered?

<img onclick="my_trker('')".....>

what I have done is:

Testing image:
<a href="" name="linkImg1"
onclick="javascript:my_trker('http://www.mywebsite.com/akohan');" >
<img name=img1 src="flower.gif" border=0 >
</a>

the problem is that when I click on this image it goes thru the
function but then the page changes to the path:
http://www.mywebsite.com/akohan and shows a list or directory of the
files I have there!

Because you navigated there with the link.

2) Is it possible to create new events in Javascript? lf so, how can I
monitor an event when user does a right-click on a link or image?

onmousedown, onmouseup, and onclick

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Temporarily at: http://members.aol.com/_ht_a/hikksnotathome/cljfaq/
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
.



Relevant Pages

  • Re: IIS permissions with viewing local files
    ... HOWTO: Troubleshoot IUSR_machine Permissions Problem ... > the file which happens to be an image file. ... > I am getting the error off the script of Access is denied. ... The javascript that I wrote browses and I locate and find an image ...
    (microsoft.public.inetserver.iis.security)
  • Advice on letting a user drop an image from the filesystem to a web page
    ... practices, etc.) that show how a web page through javascript could ... accept an image file that is dropped on the page from the filesystem ... image through the AJAX message. ...
    (comp.lang.javascript)
  • Re: Here, lets see what you JavaScript programmers have got
    ... really are on JavaScript for program making. ... like an image file. ... program" and as "just script kiddie stuff". ...
    (comp.lang.javascript)
  • events and image
    ... image file an event get triggered? ... Testing image: ... Is it possible to create new events in Javascript? ... monitor an event when user does a right-click on a link or image? ...
    (comp.lang.javascript)
  • Re: AutoPopulate web pages!
    ... Thanks very much for the response. ... not able to monitor the thread. ... and then transfer focus to and populate a web page with that ... not yet experienced in programming or javascript. ...
    (comp.lang.javascript)