I know this might be considered as duplicate, but I could not find a solution for my function below:
function countNoFilters(keyword){
keyword = typeof keyword !== 'undefined' ? keyword : "keyword="+$("#keyword-hidden").val();
var getResults = $.ajax({
type:"GET",
url:"",
data:keyword
});
getResults.done(function(data){
var results = $(data).find(".class").length;
return results;
});
}
How can I get my function 'countNoFilters("keyword")' to return the return from the .done function inside ? It would be nice if someone could write a working example for my specific function.