Forgot your password?
typodupeerror
User Journal

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.
This discussion has been archived. No new comments can be posted.

JSON: Javascript Unusable on the Client

Comments Filter:

What's the difference between a computer salesman and a used car salesman? A used car salesman knows when he's lying.

Working...