1 json作用:用于数据传递
2 常用格式:数组和对象
2.1数组:
[
{
"id":1,
"name":"weapen",
"damage"::10000
},
{
"id":2,
"name":"drug"
"hp":10000,
"mp":10000
}
]
2.2对象:
{
"name": "BeJson",
"url": "http://www.bejson.com",
"page": 88,
"isNonProfit": true,
"address": {
"street": "科技园路.",
"city": "江苏苏州",
"country": "中国"
},
"links": [
{
"name": "Google",
"url": "http://www.google.com"
},
{
"name": "Baidu",
"url": "http://www.baidu.com"
},
{
"name": "SoSo",
"url": "http://www.SoSo.com"
}
]
}