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