[jQuery] Re: Noob question about accessing element contents

2008-07-03 Thread ml1
This forum is about using jQuery, thus I assumed that I didn't have to spell out that I indeed of course meant the best jquery way. Thank you for your answer.

[jQuery] Re: Noob question about accessing element contents

2008-07-02 Thread Michael Geary
One answer: Use the technique you mentioned, or any of the techniques the others suggested. They will all work and are all fine to use. Another answer: In code that is performance critical, you may want to bypass all that and go right to the metal. Each of your "item" elements contains a single

[jQuery] Re: Noob question about accessing element contents

2008-07-02 Thread Brian J. Fink
This forum is about using jQuery, so our answers will usually be focused on the best JQUERY way, not necessarily the BEST way. On Jul 2, 11:51 am, ml1 <[EMAIL PROTECTED]> wrote: > I'm trying to find out the "best practice" for getting the contents of > one particular element. I know about the ea

[jQuery] Re: Noob question about accessing element contents

2008-07-02 Thread Brian J. Fink
Let's say you've got the element stored in a variable as an XMLElement, then it would be a simple matter to refer to the jQuery object of the element itself, for example, for variable elem: $(elem,xml).text() On Jul 2, 12:10 pm, "Richard D. Worth" <[EMAIL PROTECTED]> wrote: > $('item', xml).eq(1

[jQuery] Re: Noob question about accessing element contents

2008-07-02 Thread Richard D. Worth
$('item', xml).eq(1).text() - Richard On Wed, Jul 2, 2008 at 11:51 AM, ml1 <[EMAIL PROTECTED]> wrote: > > I'm trying to find out the "best practice" for getting the contents of > one particular element. I know about the each() call. > > As I said I can use ways that seem not so efficient to get

[jQuery] Re: Noob question about accessing element contents

2008-07-02 Thread ml1
I'm trying to find out the "best practice" for getting the contents of one particular element. I know about the each() call. As I said I can use ways that seem not so efficient to get the contents of a single element but I want to know the best way. On Jul 1, 5:20 pm, Mike Alsup <[EMAIL PROTECT

[jQuery] Re: Noob question about accessing element contents

2008-07-01 Thread Mike Alsup
> I am using jquery to parse some xml.  I'm looking for the best > practice to access an elements text contents. > > Let's say my xml looks like this: > > >   >      Hello world! >         >       Goodnight moon! >     > > > I can get a wrapped set of the elements this way: $('items > item', >