我整晚都在尝试这个,但似乎无法得到
{"files": [
{
"name": "picture1.jpg",
"size": 902604,
"url": "http:\/\/example.org\/files\/picture1.jpg",
"thumbnailUrl": "http:\/\/example.org\/files\/thumbnail\/picture1.jpg",
"deleteUrl": "http:\/\/example.org\/files\/picture1.jpg",
"deleteType": "DELETE"
},
{
"name": "picture2.jpg",
"size": 841946,
"url": "http:\/\/example.org\/files\/picture2.jpg",
"thumbnailUrl": "http:\/\/example.org\/files\/thumbnail\/picture2.jpg",
"deleteUrl": "http:\/\/example.org\/files\/picture2.jpg",
"deleteType": "DELETE"
}
]}
我一直在尝试获取每个文件的名称......所以我所做的就是这样做。
var obj = JSON.parse(data.result);
for(var i in obj.files){
var urlstring;
urlstring = obj.files[i].name;
alert(urlstring);
}
但不知何故,它不允许我提醒每个人的名字......知道我该怎么做吗?