On Aug 18, 2006, at 5:54 AM, Sam wrote:

Any ... haiku appreciated.

Javascript trouble?
Ask the mailing list gurus--
It's Scriptaculous.


I borrowed code sequences from the prototype windows-class add-in which also supports dragging. There are a few new things I don't understand. First among them is Event.stop() which calls Event.preventDefault(). I don't see this in prototype.js. Anyone know what this is? Cancelling the bubbling I
understand.

From Prototype:
Event.stop = function(event) {
    if (event.preventDefault) {
      event.preventDefault();
      event.stopPropagation();
    } else {
      event.returnValue = false;
      event.cancelBubble = true;
    }
}

event.preventDefault() is a DOM event function equivalent to setting event.returnValue = false in IE or putting "return false;" in an inline event handler. It prevents the browser's default action (e.g. form submission, following the link).

TAG
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to