$$() uses CSS selectors, so you must pass in a CSS rule. Try this:
$$('a.classProjectsEditA').invoke('observe', 'click', editProjectRecord);-Hector On Wed, Apr 1, 2009 at 8:47 AM, BrentNicholas <[email protected]>wrote: > > Hello all, > > I found that the getElementsByClassName had been depricated so I'm > trying to use $$ as was suggested. I'm a bit stuck though. > > The goal is to have clicking on any link with a class of > 'classProjectsEditA' and have it trigger the function > editProjectRecord. After that I'll get the id of the record. > > script: > does not work > idProjectListTBL.$$('classProjectsEditA').invoke("observe", "click", > editProjectRecord); > > does not work either > $$('classProjectsEditA').invoke("observe", "click", > editProjectRecord); > > > html: > <table id="idProjectListTBL"> > <tr class="classProjectsEditTR"> > <td> > <a class="classProjectsEditA" id="#PROJECT_NUMBER#" > href="##">#PROJECT_NUMBER#</a> > </td> > > notes: > 1) I tried to make it trigger with 'classProjectsEditTR', but this > didn't work either. > > 2) The function 'editProjectRecord' only contains an alert for now, so > that's not failing. > > Thoughts? > > Thanks for your time, > Brent > > > --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---
