![](/img/trans.png)
[英]JQuery File Upload plugin, Internet Explorer, and IFrame transport
[英]How to parse the result from jquery upload file plugin with jquery.iframe-transport plugin?
我使用jQuery File Upload Plugin 5.26 https://github.com/blueimp/jQuery-File-Upload
因為我需要為file.ashx附加額外的參數來處理請求,所以我按照jQuery File Uploader IE9中的建議添加了jquery.iframe-transport.js 。
我的file.ashx仍然返回我json字符串(文本/純文本)的結果,如小提琴手所示,但是在完成的回調中,我僅得到一些奇怪的數據結構,其中包含諸如iframe或其他東西的形式,文件和html元素。 如何獲取json字符串(文本/純文本)結果?
謝謝。
如https://github.com/blueimp/jQuery-File-Upload/issues/659#issuecomment-2999298中所述
結果包裝到HTML中。
因此,回調只需要再一步就可以從HTML提取結果,如下所示
function(e, data) {
var result = $.parseJSON($('pre', data.result).text());
// and result can be used like before
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.