News for hackers. Stuff that matters.
Re:Don't use the jQuery .data() method. Use .attr() instead. by pxm on Sunday December 18, 2011 @05:45PM (#3367747)
Yep, latchkey, I think you might want to rethink the article. As others have pointed out, you're seeing JavaScript's behaviour, not jQuery's. And this:

  elem.data('foo', { 'a':1, 'b':2 });
  elem.data('foo'); // Returns the object
Is certainly more desirable than:

  elem.attr('foo', { 'a':1, 'b':2 });
  elem.attr('foo'); // Returns "[object Object]"

There are no comments on this comment yet.