you should be returning an apt response from your server page which handles the ajax request. I will love to have one responsecode/status which says whats the status of the operation.
$.post("someurl.php",function(data){
if(data=="success")
{
alert("Successfully Updated");
}
else
{
alert("Some error in processing!");
}
}
and from your php you return "success" if your operation is successful and return "error" if it is not successful.
EDIT : Here is how you do it with jquery ajax
jQuery post is a shortform of jQuery ajax method with post Type
$.ajax({
url: "youruel.php?querystring1=12&id=34",
success: function(data){
if(data=="success")
{
alert("Successfully Updated");
}
else
{
alert("Some error in processing!");
}
}
});
You may add the error event also to handle those too.