可能很简单,但我无法理解。我有以下命令。返回一个json数组。
var zz = fm.request({
data : {cmd : 'url', target : hash},
preventFail : true,
options: {async: true},
})
alert (zz.cmd); // or alert (zz.url);// tried every combination I can think of. Must be something wrong with the way I am calling it.
这将输出以下json。
{"url":"https://test.com/s/tx74i3t9cet49xi/vlc-record-2009-10-03-06h26m55s-http___79.125.42.98_film4_ls_auth%3D2e2fd32b2d221ce406085c03ec01722f-.ts","debug":{"connector":"php","phpver":"5.3.15","time":1.9966609477997,"memory":"4852Kb / 3932Kb / 128M","upload":"","volumes":[{"id":"l1_","name":"localfilesystem","mimeDetect":"finfo","imgLib":"gd"},{"id":"d2_","name":"dropbox","mimeDetect":"finfo","imgLib":"gd"}],"mountErrors":[]}}
我只需要提醒网址。我变得不明确了,或者什么都没有。
发布请求。
cmd url
target d2_LzY4NV9DbGllbnRCdWdzXzIueGxzeA
Source cmd=url&target=d2_LzY4NV9DbGllbnRCdWdzXzIueGxzeA
它应该是alert(zz.data.cmd)
选项哈希后的一个额外逗号。您可以在www.jsonlint.org上验证您的JSON数据/哈希再加上@Ray发布的
{
"data": {
"cmd": "url",
"target": "hash"
},
"preventFail": true,
"options": {
"async": true
}
}