I have an ajax call that returns a boolean. The method on the server works fine. How can I access the return data from this function and use it?
var hasCondition = function () {
$.ajax({
url: "mhqpreinterview.aspx/hasconditions",
type: "POST",
contentType: "application/json; charset=utf-8",
datatype: "json",
data: JSON.stringify({ questionNumber: ClickedQuestion }),
success: function (data) {
}
});
}
if (hasCondition()) {
//stuff
}