背景
我想提交一个表格,留在同一页面上并获得回复。
下面提到的代码在 Chrome、Safari 和 Firefox 中完美运行。但是它在 IE10 中不起作用。
如何让它在 IE10 中运行?
我的分析正确性=“有问题”
在 IE10 中,$('#amazonUpload').ajaxSubmit(options)
执行了,但是在服务器端没有收到 Ajax 请求,因此在客户端永远不会收到响应。
HTML
<form action="https://s3.amazonaws.com/adminportal" enctype="multipart/form-data" id="amazonUpload" method="post">
<input name="key" type="hidden" value="001e0000009vkRLAAY/Forms/${filename}" />
<input name="AWSAccessKeyId" type="hidden" value="client aws key" />
<input name="policy" type="hidden" value="really long string" />
<input name="signature" type="hidden" value="sign value=" />
<input name="acl" type="hidden" value="private" />
<input name="Content-Type" type="hidden" value="application/octet-stream"/>
<div id="uploadPage:block:j_id31"><div class="pbSubsection">
<input id="uploadfileOne" name="file" required="True" size="25" type="file" />
<input class="btn" id="myBtnId55" name="myBtnId55" onclick="uploadActComplete();" style="display:none;" type="button" value="Upload" />
</form>
JavaScript
function uploadActComplete(){
loading();
var options = {
// error: errorResponse,
// success: successResponse,
complete: function(xhr, status) {
alert('status is :- '+status );
if(status =='success')
successResponse(xhr, status);
else if(status =='error')
errorResponse(xhr, status);
}
};
$('#amazonUpload').ajaxSubmit(options);
return false;
}
function errorResponse(xhr, status) {
stoploading();
alert('File could not be uploaded, please try again.');
}
function successResponse(xhr, status) {
stoploading();
$("input[id$='invisiblesubmit']").click();
}