1

可能是一些非常简单的事情,但我无法理解。我有以下命令。这将返回一个 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
4

2 回答 2

0

选项哈希后的额外逗号。您可以在 www.jsonlint.org 加上 @Ray 发布的内容验证您的 JSON 数据/哈希

{
"data": {
    "cmd": "url",
    "target": "hash"
},
"preventFail": true,
"options": {
    "async": true
}
}
于 2012-08-28T13:24:21.783 回答
0

它应该是alert(zz.data.cmd)

于 2012-08-28T13:05:54.240 回答