[jquery-dev] Re: The Context property/parameter

2009-09-06 Thread lrbabe
I filed a bug and submitted the corresponding patch: http://dev.jquery.com/ticket/5172 comments are welcome. On Sep 6, 11:30 pm, lrbabe wrote: > Unfortunately it doesn't work like that in the latest nightly. > What is causing the most confusion is that the three following queries > do not produ

[jquery-dev] Re: The Context property/parameter

2009-09-06 Thread lrbabe
Unfortunately it doesn't work like that in the latest nightly. What is causing the most confusion is that the three following queries do not produce the same context: $("div", document.getElementById("myId")); $("div", $("#myId")); $("div", "#myId"); Actually, only the first one result in the el

[jquery-dev] Re: The Context property/parameter

2009-08-28 Thread Thijs Houtenbos
It seems fairly trivial to add some sort of 'query optimizer' so a call like $('#listing .list_item') will be rewritten to $('.list_item', '#listing'). It seems like you could basically split on the space (won't that always work?)... but at the very least calls that contain an ID should be able to

[jquery-dev] Re: The Context property/parameter

2009-08-27 Thread Van
Requiring context is a good performance rule to use for pages with tons of nodes. However, I didnt see a performance difference between providing a string or an object as the context. Perhaps your argument to throw an exception if a string is provided was for convention only, in which case it's

[jquery-dev] Re: The Context property/parameter

2009-08-20 Thread DBJDBJ
Few months ago we discussed here this very point. Also ... for my team I introduced jQuery.strict = true; // or false If it is true then context must be given and it *must* be a valid dom node. Otherwise an exception is thrown. This change was added to the jQ code. After 2 days of mad exception fi

[jquery-dev] Re: The Context property/parameter

2009-08-19 Thread ajpiano
No. I think the point is that the two are equally efficient, a fact which had initially been obscured. On Aug 18, 4:05 am, Samer Ziadeh wrote: > oh so if i do this would it be ineficient? > > var $content = $('#content'); > $('.posts', $content); > > and i should be doing this instead? > > var

[jquery-dev] Re: The Context property/parameter

2009-08-18 Thread Samer Ziadeh
oh so if i do this would it be ineficient? var $content = $('#content'); $('.posts', $content); and i should be doing this instead? var content = $('#content')[0]; $('.posts', content); On Mon, Aug 17, 2009 at 14:30, ajpiano wrote: > > Thanks for clarifying this. The very same section in Bra

[jquery-dev] Re: The Context property/parameter

2009-08-17 Thread ajpiano
Thanks for clarifying this. The very same section in Brandon's post had me confused, and also had me writing $(".these",$those[0]) since. On Aug 16, 4:46 am, James Padolsey wrote: > Thanks for your reply John. :) > > On Aug 14, 1:24 pm, John Resig wrote: > > > > That can't be true, right? It d

[jquery-dev] Re: The Context property/parameter

2009-08-16 Thread James Padolsey
Thanks for your reply John. :) On Aug 14, 1:24 pm, John Resig wrote: > > That can't be true, right? It doesn't "search the whole doc". > > Correct, it only searches the limited sub-set. > > > The "context" property may be "document" but ".myClass" is only > > searched for within "#myContainer",

[jquery-dev] Re: The Context property/parameter

2009-08-14 Thread John Resig
> That can't be true, right? It doesn't "search the whole doc". Correct, it only searches the limited sub-set. > The "context" property may be "document" but ".myClass" is only > searched for within "#myContainer", right? (this is how I see it, > after looking at the source) > > I think the mai