check_promo is an ajax function and parameter 'param' is from ajax success. How do I want to call that parameter to be processed in the next function?
I tried to display alerts but it did not match the resulting ajax
function result_promo(){
var data = '';
check_promo(function(param){ //output param is 1
data = param;
});
return data ;
}
function submit(){
var check = result_promo();
alert(check); //not showing 1 but null
}