Answer the question
In order to leave comments, you need to log in
The $_POST array is not filled, what should I do?
There is a quite ordinary ajax request:
$.ajax({
url: "API",
type: "POST",
dataType: "html",
data: ({json: JSON.stringify({language: {func: "setLang", args: ["hjg"]}}) }),
beforeSend: function () {
$("div").html("1 sec");
},
success: function (data) {
$("div").html(data);
}
});
Answer the question
In order to leave comments, you need to log in
Trouble found. The GET method - it turned out to be all the same to the address, unlike POST.
For GET address: "API" is valid. For POST, you need to specify "/" additionally.
type: "GET",
$.ajax({
type: 'POST',
url: 'url',
data:{
func: func,
args: hjg
}
})
.done(function(data) {
$("div").html(data);
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question