I want to write a JavaScript function like prompt()
or confirm()
where line execution wait until the mentioned function returned anything.
Say, I have a function abc()
which will open a popup and then return a value. I want to hold the execution where the function was called.
function abc(){
//----------
return '';
}
function abc_caller(){
var x = abc();
alert(x);
}
Can anyone please help me regarding this?