Answer the question
In order to leave comments, you need to log in
Why is the alert not displayed?
Good evening,
I'm learning ajax and why is this alert not displayed on successful submission?
function send () {
$.ajax({
type: "POST",
url: "pasha.php",
data: "test=1",
success: function(data) {
if (data == 'success') {
alert("dsqweqwes");
}
}
})
}
if($_POST['test'] == 1){ echo 'sea';}
Answer the question
In order to leave comments, you need to log in
Well, you send the string 'sea' in response, and expect to see a success in success. Is the sea a suxes?
function send () {
$.ajax({
type: "POST",
url: "pasha.php",
data: "test=1",
success: function(data) {
alert(data);
}
})
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question