Ich verwende das folgende Ajax-Skript zum POST-JSON-Objekt.POST Json-Objekt mit Ajax-Skript (Internet Explorer)
$.ajax({
url: url,
type: "POST",
data: jsonData,
dataType: "json",
contentType: "application/json; charset=utf-8;",
success: function (data) {
$('#dialog-placeholder').html('OK');
},
error: function (xhr, textStatus, errorThrown) {
$('#dialog-placeholder').html('Bad');
}
});
In Edge, Firefox, Chrome funktioniert es gut. Leider im Internet Explorer zeigt es mir folgenden Fehler an.
400 Bad Request
The collection of headers 'content-type,accept' is not allowed.
I Cors Net Web Api in Asp verwenden. – maciejka
Löschen Sie das Attribut contentType. – Jar3d
ist Ajax URL extern? – Sourabh