[jQuery] Re: ORing selectors

2007-08-18 Thread Dave Cardwell
On 17/08/07, Rob Desbois <[EMAIL PROTECTED]> wrote: > Does anyone know offhand how much overhead using .add() instead of the comma > incurs? > Is it just the additional function call? > --rob It is likely to be an additional function call or two, so the difference is negligible. If you have the F

[jQuery] Re: ORing selectors

2007-08-17 Thread Ganeshji Marwaha
I am not sure about the additional overhead, but i find comma more straight-forward because they are css selectors and we use commas to select in css anyways. -GTG On 8/17/07, Rob Desbois <[EMAIL PROTECTED]> wrote: > > Does anyone know offhand how much overhead using .add() instead of the > comm

[jQuery] Re: ORing selectors

2007-08-17 Thread Rob Desbois
Does anyone know offhand how much overhead using .add() instead of the comma incurs? Is it just the additional function call? I've always used comma in selectors but using .add() instead is much clearer as it separates the selectors in an obvious manner. --rob On 8/15/07, Matt Stith <[EMAIL PROT

[jQuery] Re: ORing selectors

2007-08-15 Thread Erik Beeson
For the record, that's documented here: http://docs.jquery.com/DOM/Traversing/Selectors#CSS_Selectors --Erik On 8/15/07, Erik Beeson <[EMAIL PROTECTED]> wrote: > > $('#X,.Y') > > --Erik > > On 8/15/07, rickdog <[EMAIL PROTECTED]> wrote: > > > > > > What is the cleanest way for ORing select resu

[jQuery] Re: ORing selectors

2007-08-15 Thread Klaus Hartl
Matt Stith wrote: I would do something like $("#X").add(".Y"); Just group the selectors: $('#X, .Y') --Klaus

[jQuery] Re: ORing selectors

2007-08-15 Thread Erik Beeson
$('#X,.Y') --Erik On 8/15/07, rickdog <[EMAIL PROTECTED]> wrote: > > > What is the cleanest way for ORing select results, e.g. returning all > DIVs with id="X" or class="Y"? > >

[jQuery] Re: ORing selectors

2007-08-15 Thread Matt Stith
I would do something like $("#X").add(".Y"); On 8/15/07, rickdog <[EMAIL PROTECTED]> wrote: > > > What is the cleanest way for ORing select results, e.g. returning all > DIVs with id="X" or class="Y"? > >