Hey folks. I am trying to apply a function to multiple tables all with different IDs. I got about halfway through copying and pasting the function and just changing the ID before I realized this was absurd. But I don't know how to do this smarter with Prototype. Here is the function:
Event.addBehavior({ 'table#BULLETINS': function() { var links = $$('table#BULLETINS tr.header').first().getElementsByTagName('a'); for (i=0; i<links.length; i++){ var link = links[i]; link.onclick = function() {return false;} } } }); So, I was copying this same code, changing "BULLETINS" to whatever ID I required. How do you parametrize this exactly? I have an arbitrary number of different IDs to apply this to, but I don't know how to get Prototype to watch for *any* of them, and then use the found ID, whichever it is, in this function. Amiri --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---