I have code like this:
jQuery("#test_btn").off("click").on("click", function () {
jQuery.ajax({
type: "POST",
url: "/api/test/",
data: {
test: "me"
},
success: async function (response) {
alert("foo");
},
error: function (e) {
console.error(e);
}
});
});
why the success function won't print an allert with "foo"? I nedd to use a promise function inside success... but nothing !