ie8 iframe无刷新上传问题_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 09:07:49
Original
981 people have browsed it

<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);                }            };        }
Copy after login

在Google和火狐下上传没问题,但是在ie下会弹出窗口


回复讨论(解决方案)

~/clue/insertdata 设置下Content-Type

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template