?
Solved

Is there reference for the javascript event handler arguments?

Posted on 2015-02-11
6
Medium Priority
?
97 Views
Last Modified: 2015-03-09
Hi Experts,

I am playing with HTML5 and javascript. I can find a very complete list of events in HTML5 elements (http://www.w3schools.com/tags/ref_eventattributes.asp). However, when I try to find out what these events can do, I found that it should be helpful if I have reference documents for the event handler arguments.

For example, if doMouseDown(event) function is the event handler of the mouse-down event of an element, then the event parameter should have pageX and pageY properties accessible in the handler.

Is there such a reference document? Where can I get it?
Thank you!
0
Comment
Question by:huangs3
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 9

Accepted Solution

by:
Brian Tao earned 2000 total points
ID: 40604842
0
 

Author Comment

by:huangs3
ID: 40606317
Hi Brian,

In this link I can see the names of the events, but how do I know the accessible properties of the event argument?
For example, I can find that there is an "onmousedown" event, but how can I efficiently find out the event handler argument (let's say it is named "arg") has properties arg.pageX and arg.pageY returning the mouse coordinates?

Thank you!
0
 
LVL 9

Expert Comment

by:Brian Tao
ID: 40607727
The upper part of the page is like what you said, and events are categorized under sections.
In the lower part of the page, there are other sections for event methods and properties (which you called event arguments). They are with subjects "Event Object", "MouseEvent Object", "KeyboardEvent Object", ... and so on

All event handlers are passed with one argument, the event object.  With the argument (usually we put it as an "e", e.g. doMouseDown(e) using your example) you can get e.altKey, e.button, e.clientX, e.clientY, ... etc.
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

Author Comment

by:huangs3
ID: 40654999
Brian's link doesn't show all the event object properties, but with the provided keyword "Event Object" I could find more references, such as:
http://www.javascriptkit.com/domref/domevent.shtml
http://www.javascriptkit.com/jsref/event.shtml
https://developer.mozilla.org/en/docs/Web/API/Event

Thank you!
0
 

Author Closing Comment

by:huangs3
ID: 40655003
sorry for the late response due to some perturbation on my side
0
 
LVL 9

Expert Comment

by:Brian Tao
ID: 40655211
Thanks for the points.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article discusses how to implement server side field validation and display customized error messages to the client.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question