Event delegation is a technique of observing events on an ancestor
element (positioned "higher" in DOM) and exploiting events' bubbling
nature (ability of ancestor to catch event originated on its
descendant). It all just sounds complicated but essentially means
this:

document.observe('click', function(e) {
  if (e.findElement('#myLinkId')) myFunction(e);
})

Now myFunction will be called only if user clicks on an element with
specified id (and simply ignoring everything else)

Hope this helps.

Best,
kangax
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to