The code after the alert()
call won't be executed until the user clicks ok to the alert, so just put the code you need after the alert()
call.
If you want a nicer floating dialog than the default javascript confirm()
popup, see jQuery UI: floating window