Similar to this question about jQuery custom events, I'm trying to find out what the effect of return false;
is, with the exception that I am not using jQuery. I'm triggering a custom event via the following method:
var event = document.createEvent('Event');
event.initEvent('CustomName', false, true);
element.dispatchEvent(event);
This is wrapped in a function, and I return the event object after dispatching the event. Now, I'm looking for a way in the triggering code to see if one of the listeners returned false
so that I can prevent further execution. How would I be able to detect if one of the listeners returned false
in a cross-browser manner (IE 7+)?