How can I force a function to wait for an event to trigger?
I want something like a confirmation box, that user can not do anything until he/she answers the question.
Something like this:
function ask() {
if ($('a').click(function())) {
return true;
}
return false;
}
PS: I know how to use “confirm()” in js. I’m writing a new sample of it!
Work with two functions: