Oh, I see. I thought you were calling .data(name) and getting a jQuery object back instead of value. Sorry. Yeah, that looks like an error in the docs. Returns the jQuery object, as nearly all jQuery methods do (except in cases like .data(name) where they're a getter and can't return a jQuery object to continue the chain).
- Richard On Tue, Dec 9, 2008 at 7:02 PM, mgl <[EMAIL PROTECTED]> wrote: > > I think it's just mis-documented...or I'm misunderstanding the > documentation format. From what I can tell, the docs say that > jQuery.data( name, value ) should return *value* (i.e., the second > argument), when it actually returns the jQuery object. The latter is > more useful, as George's example illustrates. If the docs were > correct, George's example above wouldn't work, since the addClass > method would be expected as a member of the object '{ first: 16, last: > "pizza!" }' that was added as the value. > > On Dec 10, 12:50 pm, "Richard D. Worth" <[EMAIL PROTECTED]> wrote: > > Do you have some sample code showing the problem? > > > > - Richard > > > > On Tue, Dec 9, 2008 at 5:12 PM, mgl <[EMAIL PROTECTED]> wrote: > > > > > The docs athttp://docs.jquery.com/Coresay that jQuery.data > > > (name,value) should return the value, but instead it seems to be > > > returning jQuery. Is this what is supposed to happen? >