User Id :    Password :      New Member   Forgot Password  
 
An introduction to JSON
Description JSON is a very lightweight data format based on a subset of the JavaScript syntax, namely array and object literals. JSON allows communicating with server in a standard way. JSON is used as communication notation instead of XML.   No. of Views     1589
  Rating     3
Author Ahsan Murshed   Posted On     15 Jul 2010
Tags ASP.NET,Java Script,HTML,Web Service,Ajax,JSON    

Sample Code   Download Code

Introduction to JSON

JSON is a very lightweight data format based on a subset of the JavaScript syntax, namely array and object literals. JSON allows communicating with server in a standard way. JSON is used as communication notation instead of XML.

JSON objects are typed while XML data is typeless
1.JSON types: string, number, array, boolean,
2.XML data are all string

JSON stands for Javascript Object Notation which is a data structuring format that is extremely clean and lightweight. Even though JSON is native to javascript (as in, it can be turned into an object directly by javascript), it is quite easy to handle with other languages, making it an ideal replacement of XML when javascript is involved with the exchange of data (i.e. ajax).
var fruitColors =
{
"apple":"green",
"banana":"yellow",
"orange":"orange"
};

alert(fruitColors .apple); //outputs "green"
alert(fruitColors .orange); //outputs "orange"


The above code creates an javascript object bike with two properties apple and orange

JSON Structures
• A collection of name/value pairs
In various languages, this is realized as an object, record,struct, dictionary, hash table, keyed list, or associative array
• An ordered list of values
In most languages, this is realized as an array, vector, list, or sequence

JSON Object Notation
• A JSON object is an unordered set of name/value pairs
• A JSON object begins with { (left brace) and ends with } (right brace)
• Each name is followed by : (colon) and the name/value pairs are separated by , (comma)

For more info please visit:
http://msdn.microsoft.com/en-us/library/bb299886.aspx
http://www.json.org/
http://en.wikipedia.org/wiki/JSON

About Author

About Author I am working as Software engineer having 4+ years of experience in Microsoft Technologies, System Design and Integration and deployment, Search Engine Optimization (SEO). I have developed web based application in asp.net/C# and database design. My Site: http://www.dotnetboss.com My blog: http://aspboss.blogspot.com Ahsan
No Photo
 
Country N/A
Company N/A
Home Page N/A

Rate this article

Rating options from poor, fair, good, very good to excelent.  
 

Comments

   
Write your comment here.
Comment
Verification Code