Interesting idea. It doesn't look like data attributes are widely implemented yet, according to http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#embedding-custom-non-visible-data-with-the-data-*-attributes.  We could stuff the json into an ordinary attribute - but it seems to me that this is a lot simpler.  What's the cost of a line of inline javascript?