1
获得价值
我是新来的JSON构建JSON对象,并从JSONObject的
我得到JSON结果以HTML的格式如下
JSON结果
Alert(result)
{"resort0":"Abaco Beach Resort at Boat Harbour","resort1":"Alexandra Resort","room0":"1 Bedroom Luxury Oceanfront Suite","room1":"2 Bedroom Deluxe Ocean View Suite","room2":"Deluxe Garden View Studio","room3":"Deluxe Ocean View Studio","room4":"Deluxe Oceanfront","room5":"Oceanfront","room6":"Superior Oceanfront"}
alert(result.resort1); // alert "undefined"
alert(result.resort0); // alert "undefined"
。我如何获得这样的格式与Java代码JSONObject 是度假村是地图的关键?
{
"Resorts" : [
{ "name" : "Resort1", // First element
"room1" : "rooms1"
"room2" : "rooms2" },
{ "name" : "Resort2", // Second element
"room1" : "rooms1",
"room2" : "rooms2", }
]
}