I want the check_membership() function below to return the AJAX "data". However, "result" keeps getting set to the XHR object, not the returned JSON object.
How do I fix this?
function check_membership() {
var result;
result = jQuery.ajax({
type: 'POST',
url: '/ajax/member',
dataType: 'json',
async: false,
success: function(data) {
return data;
}
});
return result;
}
Thanks.