[jQuery] Re: $.data question

2009-07-07 Thread Steven Yang
hi sorry just wondering if there is anything input on this?by the way i am currently creating my own object to store the data but wish to use jQuery's data directly Thanks a lot

[jQuery] Re: $.data question

2009-06-29 Thread Steven Yang
Hihere is my case please tell me if its reasonable or not or is there a "correct" way to approach this in our application we use empty string as a default value i was doing a double select function and i want to cache the value from data get from using getJSON. I know that I probably should use G

[jQuery] Re: $.data question

2009-06-29 Thread Ricardo
Well, data is saved onto an indexed cache. You can't have an empty string as a key, you need a name for it. If you don't provide a name you'll get back the internal ID of the selected element. // from jQuery source, data.js ln 27 return name ? jQuery.cache[ id ][ name ] : id; Any reason yo

[jQuery] Re: $.data question

2009-06-29 Thread Steven Yang
Hi sorry for my bad example i did use something like what you said but something like $("#something").data('', mystuff); then $("#something").data('');

[jQuery] Re: $.data question

2009-06-29 Thread Ricardo
You shouldn't use $.data directly, it's for the internals. You should be using data() on elements, like $('#someelement').data('name', 'Roger'); see here: http://docs.jquery.com/Core/data and here: http://docs.jquery.com/Internals On Jun 29, 4:41 am, Steven Yang wrote: > Hi > Sorry if its alre