0
我正在使用jQuery的filedrop插件将图像上传到我的网站imgur。 PHP脚本返回{"status":"Imgur code: cZ8gH"}
Filedrop JSON响应
我想将此作为警报返回,但我无法弄清楚如何执行此操作?
我现在有这个
uploadFinished:function(i,file,response){
$.data(file).addClass('done');
var jsonobj = $.parseJSON(response);
alert(jsonobj.status);
// response is the JSON object that post_file.php returns
}
但它不工作?
也许响应已经被解析。 'response.status'工作吗? – Thomas
这是!谢谢,我没有想到 –
使用带有控制台(或Firebug Lite)的浏览器并调用'console.log'而不是'alert'总是更好。 – Thomas