/ Published in: JavaScript
This is useful if I have an element that is inside a container, and I want to the element's event handler to fire without triggering the container's event handler. Then I would wrap the element's event handler function with this code.
See "PPK On JavaScript," pp. 315 and 323.
Expand |
Embed | Plain Text
function doSomething (e) { var event = e || window.event; [body of event handler function goes here] if (event.stopPropagation) { event.stopPropagation(); } else { event.cancelBubble = true; } }
You need to login to post a comment.
