JSON Is Now An ECMA Standard
Written by Ian Elliot   
Monday, 14 October 2013

JSON, a way to represent data in JavaScript, has spread well beyond its humble origins and has now received the official accolade of an ECMA standard. 

JSON - JavaScript Object Notation - is such a simple idea that once you have seen it then there seems to be no reason not to use it or to seek something more complicated. It was originally specified and popularized by Douglas Crockford. Until now, however, the only standard relating to it was RFC 4627. 

jsonlogo

The basic idea of JSON is to package data as a JavaScript object. For example:

 "firstName":"Douglas",
   "lastName":"Crockford"
}

This can be regarded as abstract markup, like XML say, or it can be read as a fully functioning JavaScript object, which can be instantiated using the Eval function. Of course, the big problem is that if JSON is received from an untrusted source it might contain JavaScript methods as well as properties, which is a potential security problem. To stop this happening JSON idoesn't let you use just any JavaScript object you care to create, but defines a restricted set which allows building static data structures. 

In JSON you can have numeric, string and Boolean values. You can also have Arrays and objects. You can also use null to indicate no data. This is fairly restrictive but usually more than enough to code up data to be sent serially across a connection or returned by an API etc. 

 

jsonecma404

 

The new ECMA standard is number 404, a value that has raised the worry that it might be some sort of elaborate joke - 404 being the well- known Page not found HTTP error. It formalizes the restrictions and extensions of JSON over native JavaScript.  The idea is that you can parse the JSON to check that it is valid and then make use of it without having to worry about security problems.

jsonnumber

 

In practice, of course, we have been able to do this for some time in JavaScript using the JSON object, either provided natively in the browser or via a library. The standard is also important for JSON's increasing support in languages other than JavaScript where the notation isn't natively supported. 

In a very short time JSON has overtaken XML as the standard data markup for the web. In combination with Ajax and REST it has also overtaken the overly complex SOAP Remote Procedure call. 

jsonlogo

 

 

More Information

ECMA 404

Douglas Crockford's Announcement of The ECMA statndard

http://json.org/

Related Articles

WCF Data Services 5.6 With JSON Support       

JSON Linked Data       

15 Years of XML        

Programmer's Introduction to XML       

The truth about REST

 

To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, FacebookGoogle+ or Linkedin,  or sign up for our weekly newsletter.

 

blog comments powered by Disqus

 

Banner


China Plans To Oust Windows
01/09/2014

China is making progress with its own operating system designed to replace Windows, Android and iOS. Should we be worried? 



Windows 9 Coming Soon
26/08/2014

At the moment what we know about Windows 9 is mostly rumor, but it is fairly reliable rumor. It seems that Microsoft has something to announce on September 30th and we can start to prepare for the cha [ ... ]


More News

 

 

 

Last Updated ( Monday, 14 October 2013 )
 
 

   
RSS feed of news items only
I Programmer News
Copyright © 2014 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.