Why wouldn't you just use $$(".someClass") rather than getElementsByTagAndClassName(null, "someClass")?
Just curious... Jason Bunting > -----Original Message----- > From: mochikit@googlegroups.com [mailto:[EMAIL PROTECTED] On > Behalf Of machineghost > Sent: Tuesday, August 19, 2008 10:29 AM > To: MochiKit > Subject: [mochikit] Random Ideas for Mochikit.DOM > > > Hey All, > > I use a couple of "alias" functions in every project where I use the > DOM library: > > /* > Shorten getElementsByTagAndClassName, because we know that we're > getting elements (nothing else has a tag/class) and we know we're > doing it by the "name" of the class or tag, because there is no other > way to identify a tag or class (pretty much all they are is a name). > */ > var getByTagAndClass = getElementsByTagAndClassName; > > /* > I use getElementsByTagAndClassName(null, "someClass") all the time, > and it seemed silly to have to repeat a longer function name and a > "null, " every time. > */ > var getByClass = partial(getByTagAndClass, null); > > Any chance of either of these making it in to Mochikit proper? BTW, > even if the first one was implemented, I'd still think we should keep > it as an alias (rather than changing getElementsByTagAndClassName) to > avoid breaking old code. Also, if the maintainers' really like long > function names for some odd reason, the second one could just as > easily be implemented as "getElementsByClassName" and still provide > the same usefulness. > > > > No virus found in this incoming message. > Checked by AVG - http://www.avg.com > Version: 8.0.138 / Virus Database: 270.6.5/1620 - Release Date: 8/19/2008 > 6:04 AM --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "MochiKit" group. To post to this group, send email to mochikit@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/mochikit?hl=en -~----------~----~----~----~------~----~------~--~---