html部分 转载滴
<form id="importBookForm" action="uploadReadBook.action" encType="multipart/form-data" method="post" target="hidden_frame">
<input id="myFile" name="myFile" type="File" /></a><input id="submit" class="btn" type="submit" value="导入资源"></form><iframe name='hidden_frame' id="hidden_frame" style='display: none'></iframe>js部分
$('#hidden_frame').load(function(){
var text=$(this).contents().find("body").text();
// 根据后台返回值处理结果
var j=$.parseJSON(text);
if(j.status!=0) {
alert(j.msg);
} else {
alert('导入成功');
//location.href='BookResourceList.jsp'
}
});
浙公网安备 33010602011771号