I need your help because i can't callback the value from the function
look my example:
var data = askQuestion('Are you sure want to continue without adding a server', function(val){
return val;
});
console.log(data);
function askQuestion(msg, callback){ $.confirm({
title: '',
content: msg,
type: 'dark',
theme: 'light',
animation: 'none',
animateFromElement: false,
columnClass: 'medium',
onContentReady: function () {
},
buttons: {
ok: {
text: 'Συνέχεια',
btnClass: 'btn-dark float-right',
action: function(){
callback(56);
}//end action
},//end ok
close: {
text: 'Ακύρωση',
btnClass: 'btn-dark float-left',
action: function(){
callback(59);
}//end action
}
}
});
}
How i can to return val into "data" variable and print after that in console.log?
console.log now is not working callback;
i want to check variable 56 or 59 and ONLY if i have result 56 or 57 to continue my code.
Please little help