Forum Moderators: open
$.ajax({
type: "POST",
url: "process/subscribe_process.php",
data: dataString,
success: function() {
$("#message").html("Everything's good!");
//I need something here to confirm if mysql_query was done or not
},
error: function() {
$("#message").html("Error!");
}
});
<?php
// susbscribe_process.php
// insert into database
// if no problems
// echo "success";
// else
// echo "error";
?>
$.ajax({
type: "POST",
url: "process/subscribe_process.php",
data: dataString,
dataType: "text",
success: function(data) {
if (data == "success") {
$("#message").html("Everything's good!");
}
else {
// there was an error
}
},
error: function() {
$("#message").html("Error!");
}
});