AJAX is asynchronous. You cannot get the return data successbecause it is jQuery $.ajaxthat will call it and it does not listen on the return value. AjaxReturnData will exit as soon as the request is sent, and not when it receives a response.
( . "AjaxReturnData" , , , ajax )
function removeMember(id,url){
var data = "action=removeMember&id="+id;
var action = ajaxReturnData('POST',data,url,function() {
$(".msg").html("done");
$("#span_delete_"+id).parent().parent().empty().hide("slow");
}, function() {
$(".msg").html("failed");
});
}
function ajaxReturnData(method,data,url,onSuccess,onError){
$.ajax({
url: url,
data: data,
type: method,
success: onSuccess,
error : onError
});
}