Answer the question
In order to leave comments, you need to log in
What is the correct way to use ajax to get json?
jQuery.ajax({
url: "file.php",
type: "POST",
data: $("#form").serialize(),
dataType: "json",
success: function (result) {
if (result) {
console.log(result.message);
} else {
alert(result.message);
}
return false;
},
error: function () {
console.log("ошибочка, проблема с ajax");
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question