2013-09-24 60 views
-1

我写了下面的代码,我期待一个JSON对象,但总是返回一个字符串与文件的名称。罚款上传resposeJSON

var app=$('#failed-fine-uploader').fineUploader({ 
    request: { 
     endpoint: 'media/upload.php' 
    } 

}).on('complete', function (id, name,responseJSON) { 
    alert(responseJSON.success); 
    alert(responseJSON); 

}); 

responseJSON.success未定义,responseJSON是一个字符串。

这是upload.php的响应:

{"success":"true","id":54,"type":"image\/jpeg","size":22568,"ext":"JPG","uploadName":"100-0027_IMG-645.JPG"} 

我想读取JSON的值等的尺寸和类型。

+0

“restitutisce”是什么?猜猜“返回” – djot

+0

是的,抱歉的错误 – Andrew

回答

0

既然你有双重发布这个问题,我回答了github回购的问题跟踪器,我会在这里粘贴我的回复。

您的处理程序不正确。使用jquery插件时传递给事件处理程序的第一个参数始终为“event”。看看文档中的jquery插件部分。

相关问题