As noted in this question, in a function
function(e){
e.stopPropogation();
}
e is the event object. But why? Is the first and only argument assumed to be the event? What if there are two arguments? How would I make the second refer to the event instead? Or is it as simple as saying
function(something,x){
x.stopPropogation();
}
because I would assume x would be undefined, and wouldn’t expect it to automatically become an event object by virtue of having event methods called on it.
For DOM events, the first argument (and only one usually) is the event object.
For frameworks, it depends on the implementation, but to maintain consistency they will usually pass the event in the first parameter as well..
You are right to assume the
xwill be undefined..have a look at https://developer.mozilla.org/en/DOM/event