标签:上海 快捷 value 有序 span nts ges 1.0 .net
JSON的具体形式
1、对象是一个无序的“‘名称/值’对”集合。一个对象以“{”开始,以“}”结束。每个“名称”后跟一个“:”,“‘名称/值’对”之间使用“,”分隔。
举个例子:
{
name:"张三" ,
password:"123456" ,
department:"技术部" ,
sex:"男",
old:30
}
这种格式的就是json格式
2、数组是值(value)的有序集合。一个数组以“[”开始,“]”结束。值之间使用“,”分隔。
例如:
hotellist: { point:{name:"复旦大学",lat:31.2965930000,lng:121.5035790000}, hotels: { P2472:[1977,"上海复旦皇冠假日酒店",2472,"|IHG|FD|HGJR|FDHG|SHFDHGJRJD|",5,0,"酒店位于杨浦区,正对着享有盛名的复旦大学。紧邻新近开业的万达商业广场,巴黎春天,沃尔玛大型超级市场及各种餐饮娱乐设施。便利的交通让您从容地到达上海的金融区、外滩、浦东和旅游胜地。",788.00,906,"UploadPhotos/200823111239573.bmp","上海杨浦区邯郸路199号","310000",24,48,"121.50185823440552","31.29514607529246",16,0,0,"HOT",28,"<img src=http://hbe.hubs1.net/json2/images/hotel/ABusiness.gif hspace=2 title=商务中心/><img src=http://hbe.hubs1.net/json2/images/hotel/ARestaurant.gif hspace=2 title=餐厅/><img src=http://hbe.hubs1.net/json2/images/hotel/APool.gif hspace=2 title=室内游泳池/>",0.26], P7601:[5329,"汉庭快捷上海复旦店",7601,"|HT|FD|",0,0,"汉庭快捷复旦店位于上海市虹口区松花江路2628号(近邯郸路),毗邻复旦大学、同济大学、上海外国语大学和上海财经大学。",189.00,256,"UploadPhotos/2009109134232740.jpg","松花江路2628号(近邯郸路)","310000",26,48,"121.49858862161636","31.29252175003388",25,0,0,"INN",35,"<img src=http://hbe.hubs1.net/json2/images/hotel/ARestaurant.gif hspace=2 title=餐厅/>",0.64],P8256:[5975,"上海复旦燕园宾馆",8256,"|FDYY|",0,3,"上海复旦燕园宾馆毗邻复旦大学邯郸校区、五角场商业中心地带,地理位置优越,环境优雅,闹中取静。",428.00,428,"UploadPhotos/201032610403481.jpg","上海杨浦区政通路270号","310000",24,48,"121.50974929332733","31.302058358737085",7,0,0,"HOT",0,"<img src=http://hbe.hubs1.net/json2/images/hotel/ABusiness.gif hspace=2 title=商务中心/><img src=http://hbe.hubs1.net/json2/images/hotel/ARestaurant.gif hspace=2 title=餐厅/>",0.83], ... } }
{ points:[ {name:"虹桥机场",lat:31.1939,lng:121.346}, {name:"浦东机场",lat:31.1488,lng:121.801}, {name:"上海南站",lat:31.1533,lng:121.429}, {name:"上海站",lat:31.2494,lng:121.459}, {name:"光大会展中心",lat:31.1665,lng:121.429}, {name:"国际会议中心",lat:31.2395,lng:121.497}, {name:"国际展览中心",lat:31.2032,lng:121.404}, {name:"八佰伴",lat:31.2265,lng:121.519}, {name:"长风公园",lat:31.224,lng:121.4}, {name:"东方明珠广播电视塔",lat:31.2399,lng:121.5}, {name:"动物园",lat:31.194,lng:121.364}, {name:"方塔园",lat:31.0038,lng:121.248}, {name:"古城公园",lat:31.2285,lng:121.494}, {name:"国家森林公园",lat:31.6768,lng:121.481}, {name:"海洋水族馆",lat:31.2406,lng:121.502}, {name:"和平公园",lat:31.2703,lng:121.506} ...... ] }
3、值(value)可以是双引号括起来的字符串(String)、数值(number)、true、false、null、对象(object)或者数组(array)。这些结构可以嵌套。
4、字符串(string)是由双引号包围的任意数量Unicode字符的集合,使用反斜体转义。一个字符(character)即一个单独的字符串(characeter
string)。
标签:上海 快捷 value 有序 span nts ges 1.0 .net
原文地址:http://www.cnblogs.com/fengli9998/p/6679832.html