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
fire-fighting, this (pretty complex) web app started behaving. The
issue was that a) hardly any one was using context b) of remining 2
developers, no one has used it by passing a dom node. While in the
same time app size was exponentially growing.

So, for me the value of the idea of the context is proven. It is only
that it has very unfortunate name, and also that it is poorly
documented and explained. Until one looks into the code and sees the
find() usage. Then everything becomes clear, but not before.

Brandon has written a post which is good. It is only that I have a
problem with the necessity to have this post ;o)
In essence Brandon shows (by now) the obvious: dom node should be
allways passed as the "context" argument. After the post one can see
an "sea" of comments where this difference between "correct" and
corect, context is explained. Good.
But. Is it now trhat we have to adhere to :
1:using the context "correctly" (in quotes)
or is it
2:using the context correctly ?
IF(2) THEN
Why not just enforcing this in jQ 1.3.3 ?
var context = $('#primary')[0];
$('a', context); // OK
$('a', "#primary"); // throw an exception
END IF

(repeat: consistent use of dom nodes as a contexts, made our large
pages behave again, with jQuery)

What is the point of allowing incorrect usage?
Or is it "incorrect" usage ;o)

-- DBJ
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to