What can I do with JSON?
I want to, in brief, fin开发者_开发问答d out about what I can do with JSON; whether it is an alternative for JavaScript or what?
JSON is short for JavaScript Object Notation. It is a data format used for passing around data, modeled after the Javascript syntax for object/list literals. It is not a programming language, but rather a data markup language.
It's just a data format that converts data structures such as objects & arrays into a string representation. It uses the same format as javascript and is very easy to work with in ajax based applications because of this.
What can you do with json? anything that any other major data format can do. It's just data. What you can do with it is up to you.
JSON (an acronym for JavaScript Object Notation) is a lightweight text-based open standard designed for human-readable data interchange. It is derived from the JavaScript programming language for representing simple data structures and associative arrays, called objects
JSON is built on two structures:
- A collection of name/value pairs.
- An ordered list of values.
For more on JSON
In a brief JSON is JavaScript Object Notation. Which for example instead of doing:
var obj = new Object( );
obj.arr = new Array( );
obj.name = new String ( "Jhon Doe");
You can do:
var obj = { name: "Jhon Doe", arr: [1,2,3,4]};
So once browser will receive or meet some peace of JSON it would be able to compile it into Javascript object, so you will be able to use itt later in the code and reference to it.
精彩评论