JSON course



JSON: JavaScript Object Notation(JavaScript Object representation )

JSON Is the syntax for storing and exchanging text information , similar XML.

JSON than XML Smaller 、 Faster , Easier to parse .

JSON example

{ " sites " : [ { " name " : " Programming tutorial " , " url " : " bcen.cdmana.com " } , { " name " : " google " , " url " : " www.google.com " } , { " name " : " Microblogging " , " url " : " www.weibo.com " } ] }

This sites Objects are objects that contain 3 Site records ( Object ) Array of .


What is? JSON ?

  • JSON refer to JavaScript Object representation (JavaScript Object Notation)
  • JSON Is a lightweight text data exchange format
  • JSON Independent of language :JSON use Javascript Syntax to describe data objects , however JSON Still independent of language and platform .JSON Parser and JSON The library supports many different programming languages . At present, there are many developments (PHP,JSP,.NET) Programming languages support JSON.
  • JSON Self descriptive , Easier to understand

JSON - Convert to JavaScript Object

JSON Text formatting is syntactically different from creating JavaScript The code of the object is the same .

Because of this similarity , No parser required ,JavaScript Programs can use built-in eval() function , use JSON Data to generate native JavaScript Object .