学习:https://blog.csdn.net/qq_25221835/article/details/85759510
$.ajax({
type:"POST",
dataType:"json",
url:prefix + "/import",
async:false,
processData: false, // jQuery不要去处理发送的数据
contentType: false, // jQuery不要去设置Content-Type请求头
data:formData,
success:function(data){
$.modal.msgSuccess("导入成功");
$('#dr',parent.document).val(JSON.stringify(data.rows));
$('#dr',parent.document).click();
$.modal.close();
},
error:function(){
$.modal.msgError("导入失败");
}
});
ajax返回数据为list,转换为json字符串格式,返回给父级页面
父级页面代码
<input id="dr" name = "dr" type="hidden" value="" onclick="change(this)"/>
function change() {
具体根据自己需求写
}