I have an ajax query sending to a php script and putting the response into a div. The code is as follows:
$.ajax({
type: "POST",
url: "core/process.php",
data: data,
success: function(response){
$("#form").fadeOut('slow');
alert("DO NOT LEAVE THIS PAGE UNTIL COMPLETE");
$("#response").html("DO NOT LEAVE THIS PAGE UNTIL COMPLETE<br />")
.append(response)
.hide()
.slideDown('slow');
}
});
What I want to do is check the response for a string or return such as "true" or "success" or whatever and alert the user the script is complete. I know very little jQuery beyond what you see above and am not sure how to search a response for something specific.
Edit: I just realized I forgot to put how the script outputs the response. It's just echoing in the php script. I'm thinking I may need to put everything into an array and json_encode it, but that's just a guess.