我有一个jquery代码(在mvc3中调用控制器),它在chrome中工作正常,但它在IE11中不起作用:
$('#fileUpload').fileupload({
url: baseUrl + 'UploadAttachments',
dataType: 'html',
formData: { formId: $("#SelectedFormId").val(), formCompletedStatusId: $("#FormCompletedStatusId").length > 0 ? $("#FormCompletedStatusId").val() : $("#FormCompleteStatusId").val(), formRejectedStatusId: $("#FormRejectedStatusId").val() },
add: function (e, data) {
jqXHRData = data
$("#fileUploadFileName").val(jqXHRData.files[0].name);
},
done: function (event, data) {
$("#tabs-2").html('');
$("#tabs-2").html(data.result);
jqXHRData = "";
},
fail: function (event, data) {
if (data.files[0].error) {
alert(data.files[0].error);
}
},
submit: function (e, data) {
}
});
);
以下事件触发该功能:
$("#btnUpload").live("click", function () {
if (jqXHRData != "") {
if (checkFileExtention(jqXHRData.files[0].name)) {
AjaxLoading();
setTimeout(function () { jqXHRData.submit(); }, 1000);
}
}
});