Using jQuery Data for Easy Data Associations
eng.pulse.me
eng.pulse.me
Also .data() lets you access HTML5 data-* attributes. Note, that doing so values are converted to proper objects if possible. See http://jsfiddle.net/wLfJV/1/
Unrelated, but worth reminding: don't use $(this).attr('id')— this.id is simpler and much much faster: http://jsperf.com/el-attr-id-vs-el-id/2
html5 data: those are the attributes that i was referring to in the beginning of the post.
I'm actually planning on using this method, so I'd really like to know.
[1] "Furthermore, storing data takes a certain amount of time, so you might get a null exception if you are planning on retrieving it right after storage. There are currently no plans to add a callback to the jQuery data that I’m aware of."
Edit: $.data() seems to be async, but $(el).data() is not. At least that's what I found. Maybe that explains the difference in speeds.
DOMObject.my_special_site_id.specific_data1
DOMObject.my_special_site_id.specific_data2
Nasty global variableses...