I have this function that I calling from within another function
function CheckForSession() {
var str="chksession=true";
jQuery.ajax({
type: "POST",
url: "chk_session.php",
data: str,
cache: false,
success: function(res){
if(res == "0") {
alert('Your session has been expired!');
}
}
});
}
How can I make the entire function CheckForSession return false if the response equals 0?
P.S. In my application, the response to this function can only be either 1 or 0.