简体   繁体   English

Jquery文件上传插件如何获取从服务器发送的响应

[英]Jquery file upload plugin how to fetch Response sent from server

i am using jquery file upload plugin provided at https://github.com/blueimp/jQuery-File-Upload now the problem is that i am returning image paths for the matching images that i just uploaded if following format. 我正在使用https://github.com/blueimp/jQuery-File-Upload提供的jquery文件上传插件现在问题是我正在返回我刚刚上传的匹配图像的图像路径,如果遵循格式。

["upload\/2014-04-08-17-04-39000000_d.jpg","upload\/2014-04-08-17-04-39000000_d.jpg","upload\/2014-04-08-17-04-39000000_d.jpg","upload\/2014-04-08-17-04-39000000_d.jpg","upload\/2014-04-08-17-04-39000000_d.jpg","upload\/2014-04-08-17-04-39000000_d.jpg","upload\/2014-04-08-17-04-39000000_d.jpg"]

now i cant figure out that how can i fetch this reponse. 现在我无法弄清楚我怎么能得到这个响应。 I mean usually ajax response can be fetched within success function but i cant figure out where is similar function in the following uploader. 我的意思是通常ajax响应可以在success函数中获取但我无法弄清楚以下上传器中的类似函数在哪里。

In fileupload.js there is a call back function done. 在fileupload.js中有一个回调函数完成。 Use this code. 使用此代码。

done: function(e, data) {
                var r = data.result;
                alert(r);
            },

Did you try binding: .bind('fileuploaddone', function (e, data) {/* ... */}) ? 您是否尝试过绑定: .bind('fileuploaddone', function (e, data) {/* ... */})

That should be the callback you are looking for. 这应该是你正在寻找的回调。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM