Based on a suggestion in this thread:

...I've been checking out using the element.on method rather
than .observe for monitoring descendant elements. I clearly don't
understand how to use the on method, since when I replace observe with
on in otherwise identical code the function never returns as shown

function initInternalLinkListener() {
        $('centercontent').observe('click', function(evt) { //observe works
normally. on makes the function never return
                var foo = 0;

document.observe('dom:loaded', function() {
        initContactListener(); //gets run
        new AjaxTabber('tablist'); //never run if element.on used in prior

It looks to me from the api that on and observe should be equivalent
except on allows for a css selector (which is why I'm interested in
it) and listening for decendents, so this behavior is very confusing
to me. Can anyone enlighten me on this?

Thanks a bunch.

You received this message because you are subscribed to the Google Groups 
"Prototype &" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to