On 01/12/06, Brandon Aaron <[EMAIL PROTECTED]> wrote:
> If this type of functionality starts to be
> required I would suggest including a standard way for plugins to
> easily restore state (.end()) in the core. Destructive methods will be
> no more in 1.1, so I don't think .end() will be around either.
Going a bit offtopic, but how would it work if it is non-destrutive?
<div>
</div>
<div class="foo">
</div>
<div class="foo">
</div>
$("div").eq(0).append("(first)").eq(1).append("(second)").filter(".foo").append("(has
class foo)");
If 'end' is executed before the next filter/eq etc, then the result
would be the following (rather than just the first append working).
<div>(first)
</div>
<div class="foo">(has class foo)(second)
</div>
<div class="foo">(has class foo)
</div>
Also, what if you did (I'm assuming 0 based, so lt(2) returns those
before the 3rd):
$("div").lt(2).gt(0);
Would that result in the first 2 div's being selected, or all 3? If
all three, then you would need 'between' as a function
($("div").between(0,2)). Also you may want to do something a bit more
complex:
$("div").lt(2).filter(".foo"); // should return the second div only
Or am I not understanding non-destructive properly?
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/