Since alert is blocking:
alert('foo');
function_to_call_when_oked_or_closed();
Just put the function after the call to alert.
Since alert is blocking:
alert('foo');
function_to_call_when_oked_or_closed();
Just put the function after the call to alert.