0

I use jQuery File Upload Plugin 5.26 https://github.com/blueimp/jQuery-File-Upload

Because I need to append extra parameters for my file.ashx to process request, I added jquery.iframe-transport.js as suggested in jQuery File Uploader IE9 Not posting any params on Upload

My file.ashx still returns me json string (text/plain) result as shown in fiddler, but in the done callback I only got some weird data structure which contains the forms, files and html element kind of like a iframe or stuff. How can I get my json string (text/plain) result?

Thanks.

Community
  • 1
  • 1
hurtchin
  • 128
  • 2
  • 8
  • OK, problem solved by google https://github.com/blueimp/jQuery-File-Upload/issues/659#issuecomment-2999298 – hurtchin Jul 03 '14 at 15:18

1 Answers1

1

As described in https://github.com/blueimp/jQuery-File-Upload/issues/659#issuecomment-2999298

the result is wrapped into HTML.

So the callback just needs one more step to extract the result from HTML like below

function(e, data) {
    var result = $.parseJSON($('pre', data.result).text());
    // and result can be used like before
}
hurtchin
  • 128
  • 2
  • 8