Reputation: 18600
JQuery:
this.saveButton.click(function (e) {
scope.saveForm();
});
This is a very simple line of JQuery that binds the .click() event to the saveButton object and calls a saveForm function when the event is fired.
When this event is called, what is 'e'? I don't think it is ever used.
Upvotes: 0
Views: 4154
Reputation: 6700
e
(or any other name you use) is an Event
object. It is very useful when you, for example want to determine where did the click
event take place or which key was pressed on keydown
event.
You should read this article on jQuery API.
Example usage:
$("#someInput").keydown(function (e) {
alert(e.which) // alerts the keycode of the pressed key
});
Upvotes: 0
Reputation: 17808
It's the event object. Take a look at the documentation page here:
Upvotes: 2
Reputation: 245419
Event handlers can take an optional parameter that contains information about the event that occurred. In this case, it is unused.
Upvotes: 1
Reputation: 92893
The e
can be used to obtain specific information about the click (left, right or center; coordinates clicked; DOM object clicked on), but this specific code sample doesn't use it.
See http://api.jquery.com/category/events/event-object/ for details about what's available.
Upvotes: 4