Great news! Thanks!
John Resig schrieb:
> Ferdinand -
>
> I just added in object cloning with the constructor function, you can now do:
>
> var div = $("div")
> $(div).find("span")
>
> and have the original 'div' still contain what it's supposed to.
>
> --John
___
Ferdinand -
I just added in object cloning with the constructor function, you can now do:
var div = $("div")
$(div).find("span")
and have the original 'div' still contain what it's supposed to.
--John
On 8/28/06, Ferdinand Beyer <[EMAIL PROTECTED]> wrote:
> Hi!
>
> In a recent project I often
Ferdinand Beyer wrote:
> What I would really like to see in the standard library is that jQuery
> objects can be passed to the $() function to obtain a copy:
>
> var $a = $('some.query');
> var $b = $($a);
>
> $b.filter('some.criteria'); // Does not affect $a
>
> What do you think about that?
C
> From: Ferdinand Beyer
>
> What I would really like to see in the standard library is
> that jQuery objects can be passed to the $() function to
> obtain a copy:
>
> var $a = $('some.query');
> var $b = $($a);
>
> $b.filter('some.criteria'); // Does not affect $a
It looks like jQuery 1.0 doe
Hi,
> $.fn.newQuery = function()
> {
> var c = $();
> c.cur = $.merge([], this.cur);
> return c;
> }
I don't like the name. Maybe "copy" states better what the function does.
Have you tried this kind of implementaiton:
$.fn.copy = function() {return $(this.get());};
I don't know
Hi!
In a recent project I often needed to copy a jQuery object to perform a
subquery without losing the original object. As far as I can see there
is no "official way" to do this so I came up with a small extension
function:
$.fn.newQuery = function()
{
var c = $();
c.cur = $.merge([]
Ferdinand Beyer wrote:
> Hi!
>
> In a recent project I often needed to copy a jQuery object to save a
> subquery without losing the original query. As far as I can see there is
> no "official way" to do this so I came up with a small extension function:
>
Hi Ferdinand,
though it looks like th
Hi Ferdinand,
> What I would really like to see in the standard library is that jQuery
> objects can be passed to the $() function to obtain a copy:
>
> var $a = $('some.query');
> var $b = $($a);
>
> $b.filter('some.criteria'); // Does not affect $a
>
> What do you think about that?
I snuck that
Hi!
In a recent project I often needed to copy a jQuery object to save a
subquery without losing the original query. As far as I can see there is
no "official way" to do this so I came up with a small extension function:
$.fn.newQuery = function()
{
var c = $();
c.cur = $.merge([], th