Heim > Artikel > Web-Frontend > ie8 iframe无刷新上传问题_html/css_WEB-ITnose
<form method="post" target="formtarget" action="~/clue/insertdata" enctype="multipart/form-data"> <input class="easyui-filebox" name="file" data-options="{buttonText:'选择文件'}"><br/> <input class="btn" type="button" value="取消" onclick="" /> <input class="btn" type="submit" value="导入" /> </form><iframe id="formtarget" name="formtarget" style="display:none"></iframe>js代码 var ifm = document.getElementById("formtarget"); if (ifm.attachEvent) { ifm.attachEvent("onload", function () { var data = $(window.frames["formtarget"].document).find("pre").text(); if (data != null) { insertresult(data); } }); } else { ifm.onload = function () { var data = $(window.frames["formtarget"].document).find("pre").text(); if (data != null) { insertresult(data); } }; }
~/clue/insertdata 设置下Content-Type