On 4/11/07, Jon Barnett <[EMAIL PROTECTED]> wrote:
> If you want structured data in this attribute, why not just use JSON?

That's an idea that crossed my mind as well.  I dismissed it for a few
reasons:
- authors would have to entitize quotes and ampersands in their attributes,
which they're not used to doing with JSON normally.
- evaluating it would mean:
var obj = eval(myelement.getAttribute("_myjson");

How about defining an attribute that is the name of the js variable
for use with that element? Then you can define the variable in a
<script> tag, and use pure JSON cleanly.

Kristof, JSON is in fact pretty much valid Python syntax too. It is a
Javascript subset for decalarative structures designed to interoperate
with many languages.

Reply via email to