In an arbitrary JavaScript function, I wish to determine the upstream event.
The event listener function did not pass the event do the current function. As far as I know, window.event is not WC3 and not available.
function listener(e) { subfunc(e.target); }
function subfunc( element) {
// here I wish to know which if any event responsible for me being called
var event = ?;
switch( event.type ) { ... }
}
How does function subfunc() determine the current event?
(Apologize if question asked before – seems it must have been – but cannot track it down.)
You can do:
Also other way: