IE9 uses ajaxSubmit for form submission, setting custom header does not take effect!
ask God for help.
form:
$("-sharpsubmit").on("click", function () {
var option = {
"dataType": "json",
"headers": {"x-auth-token": "123123123"},
"success": function (data) {console.log(data);}
};
$("-sharptest").ajaxSubmit(option);
return false;
})
check the request message. The custom header on IE does not exist. There is no problem with IE11.
look at the code of jquery.form.js. Because IE11 does not support the iframe implementation used by FormData, the custom header does not take effect.
ask if there is a solution to implement the form submission of file upload type on IE9 and add custom header?.