Ich habe einen AJAX-Anruf, der aufgrund seines Ergebnisses - ich sende einen anderen Anruf.Verschachtelte Javascript-Versprechen
uploadDocument = function (doc1, doc2) {
$.ajax({
type: "POST",
url: "/API/UploadDocs/addDocument",
data: doc1,
contentType: "application/json"
}).then(function (result) {
console.log(result);
doc2.id=result;
return $.ajax({
type: "POST",
url: "/API/UploadDocs/addDocument",
data: doc2,
contentType: "application/json"
}).then(function (result) {
});
});
}
Aber ich bin immer ein Illegal invocation
Fehler, was mache ich falsch?
Mögliche Duplikat [jQuery - Illegale Aufruf] (https://stackoverflow.com/questions/10324594/jquery-illegal-invocation) – smarber
@smarber Es ist nicht ein Duplikat, ich sah diese Frage, fand aber keine Antwort auf mein Problem, danke. – user3378165