JSON is a relatively new
and increasingly popular way to represent data. It is a subset of JavaScript
syntax that represents data as object literals. Due to its simplicity and
natural fit in JavaScript programming, JSON has become the de facto standard
for data interchange in HTML5 applications. The canonical API for JSON has two
functions, parse () and stringify () (meaning serialize or convert to string).
To use JSON in older
browsers, you need a JavaScript library. Parsing and serializing in JavaScript
are not always as fast as you would like, so to speed up things, newer browsers
now have a native implementation of JSON that can be called from JavaScript.
The native JSON object is specified as part of the ECMAScript 5 standard
covering the next generation of the JavaScript language. It is one of the first
parts of ECMAScript 5 to be widely implemented. Every modern browser has
window.JSON, and you can expect to see quite a lot of JSON used in HTML5
applications.
No comments:
Post a Comment