JSON stands for JavaScript Object Notation.JSON is a light weighted format that is used to exchanging and storing data.It is based on a subset of JavaScript language and JSON is text based written language.some JavaScript is not JSON, and some JSON is not JavaScript.
JSON values can consist of:objects (collections of name-value pairs) arrays (ordered lists of values) strings (in double quotes) numbers true, false, or null.JSON is language independent.
It is a much-more compact way of transmitting sets of data across network connections as compared to XML.
Sending data to the server:
var myObj = { name: "John", age: 31, city: "New York" };
var myJSON = JSON.stringify(myObj);
Receiving data from the server:
var myJSON = '{"name":"John", "age":31, "city":"New York"}';
var myObj = JSON.parse(myJSON);
JSON basic built function
JSON.stringify()
JSON.parse()
Comments
Post a Comment