Based on a suggestion in this thread:
http://groups.google.com/group/prototype-scriptaculous/browse_thread/thread/7520e6f31722bdd

...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
below:

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
        initInternalLinkListener();
        new AjaxTabber('tablist'); //never run if element.on used in prior
function
}

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 & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to