Journal scriptify's Journal: JSON: Javascript Unusable on the Client
JSON, or "Javascript Object Notation"
"is a lightweight data-interchange format....based on a subset of the
JavaScript Programming Language,
Standard
ECMA-262 3rd Edition - December 1999".
Specifically, this brainchild of
Douglas Crockford, is, in his words,
"a
subset of the literal object notation of JavaScript.
Since JSON is a subset of JavaScript, it can be used in the language with no muss or
fuss." The example Mr Crockford subsequently cites starts with the
identifier and assignment operator: "var myJSONObject = ", which it
turns out are necessary to specify such Javascript/JSON code using HTML's
script tag's
src attribute.
Other examples on the site
(e.g. sample data for a C# parser),
however, do away with the leading identifier and assignment tokens, and refer
only to the Javascript object literal and its delimiting curly braces.
This same sample data file specified as the src attribute of a script tag
results in
a
page throwing a Javascript error (made apparent by using
Firefox's
Javascript console). Furthermore, authors of a
draft version JSON parser implemented in PHP
seem unwilling to make their tool more readily usable
per the W3C's specification for HTML's script tag.
JSON: Javascript Unusable on the Client More Login
JSON: Javascript Unusable on the Client
Slashdot Top Deals