do not underestimate the power of $()
> Date: Mon, 30 Mar 2009 08:36:48 -0700
> Subject: [jQuery] Re: HELP: a = $('<p>foo</p><p>bar</p>');
> a.after('<b>xyz</b>') not adding element
> From: [email protected]
> To: [email protected]
>
>
> Thanks (late) to everybody for answering.Saw your posts just now. I
> overlooked that line in the documentation...RTFM to me! Sorry about
> that.
>
> However, do you know if there is another way to achieve the same
> result, without inserting the nodes in the DOM first?
>
> By chance, i've found the "add()" method to push more nodes inside a
> jquery object. Is this the right way to do it?
>
> a = $('<p>foo</p><p>bar</p>'); a.add('<b>xyz</b>') --> is a equivalent
> to $('<p>foo</p><p>bar</p><b>xyz</b>') ?
>
> Stephen
>
> On Feb 27, 3:48 am, mkmanning <[email protected]> wrote:
> > Sorry for not being clearer; that's what comes from posting at 3 in
> > the morning :P
> > I was going on the post's title, attempting to use .after(). As
> > Ricardo says, append/appendTo, prepend/prependTo work on newly created
> > nodes, but after/insertAfter, and before/insertBefore require that the
> > nodes be a part of the DOM.
> >
> > Check out the docs, specifically the entries for the different
> > methods, as they will tell you this and save you having to wait for
> > responses in the forum :)
> >
> > http://docs.jquery.com/Manipulation
> >
_________________________________________________________________
Free photo editing software from Windows LiveĀ . Try it now!
http://clk.atdmt.com/UKM/go/134665240/direct/01/