I'm attempting to assign the ajax response to a variable (let's call it _has_weekend_hollidays) in the following manner:
JS Call:
_has_weekend_hollidays = checkWeekendHollidays( _i );
console.log ( checkWeekendHollidays( _i ) );
AJAX Call
$.ajax({
url: "./directory/ajax_check_weekend_hollidays.php",
type: "POST",
data: {
start_date: _date1,
final_date: _date2
}
}).done(function (_result) {
return ( _first_weekday == 0 || _last_weekday_id >= 6 || _result!="0" );
}).fail(function (_result) {
console.log("ERROR:" + _resultado);
});
The AJAX response is fine but the return statement is not functioning.
Therefore, console.log displays undefined.
Any suggestions?
Thanks in advance!