In your code? I don't know.
As I said I don't use jQuery so I don't fully understand how your code is working. I'm assuing you've copied & pasted it since you don't know yourself.
If you can figure out for yourself where your responseText is being handled, you can store it in a variable, whereupon you will be able to check it for a string.
var xmlhttp = "";
var get_php = "";
if (window.XMLHttpRequest) // IE7+, Firefox, Chrome, Opera, Safari.
xmlhttp = new XMLHttpRequest();
else // IE6, IE5.
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.onreadystatechange = function()
if(xmlhttp.readyState == 4 && xmlhttp.status == 200)
// The "get_php" variable contains all data outputted by PHP.
get_php = xmlhttp.responseText;
xmlhttp.open("GET", "ajax_php.php", true);
// You'll have to fill this line in yourself, I don't know the jQuery.
var your_response_variable = some_response_text;
// Search for success or failure.
Inside the match function I am using a very basic regular expression. Anything inside the // will be the string checked for. The "i" tells the expression to ignore case.