您的位置:首页 > Web前端 > JavaScript

Introduction to JSON

2015-06-07 07:42 513 查看
JSON (JavaScript Object Notation) is a lightweight data-interexchange format. Prior to JSON, XML was the most commonly used data inter-exchange format. XML still has its dominance. But JSON is also gaining
up because of its simplicity. JSON represents the data as string:value pairs, where the value can be string, numbers, arrays, boolean values or even null value.

Take for example

1. string: number

{
"rollnumber": 1
}

2. string: string

{
"sitename": "programming"
}

3. string: boolean value

{
"student" : true
}

4. string: array

[js]

{

"tags" : [

"cpp",

"c",

"PHP"

]

}

[/js]

5. string:object (Note that object is nothing but any of the four representations shown above)

[js]

{

"site": {

"sitename": "programming",

"tags": [

"cpp",

"c",

"PHP"

]

}

}

[/js]

https://linuxprograms.wordpress.com/2010/05/20/introduction-to-json/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: