P
Paul Gorodyansky
GLC said:...
We have already accomlished what we wanted and no other handling needs
to occur, not even on the part of the browser.
So these lines are added, instead of returning false:
e.cancelBubble = true; // IE specific
if (e.stopPropagation) e.stopPropagation(); // won't work on IE
Or, skip the lines if the event is to continue propagating, like
returning true.
Thanks, I've almost reached the same conslusion - meaning that
the true and false from onkeypress={return foo()} from
http://www.faqts.com/knowledge_base/view.phtml/aid/1661
is the same as - from within the function -
let event to bubble (= true from FAQ) and
cancel bubbling (= false from FAQ)
Why I was confused at first after you showed me
e.cancelBubble = true; // IE specific
if (e.stopPropagation) e.stopPropagation(); // won't work on IE
is because in http://www.faqts.com/knowledge_base/view.phtml/aid/1661
they also used things like preventDefault while returning false
if (keyCheck.cancelKey) // cancelKey is an internal object member
{
if (evt.preventDefault)
evt.preventDefault();
return false;
What I mean is that I thought that evt.preventDefault is kind of
what you call "stop even bubbling" - so then why the FAQ example -
IN ADDITION - makes it to work as {return false}
if the event is already stopped?
But - from your example - looks like evt.preventDefault is different
from e.cancelBubble/e.stopPropagation()
Right?