I have two javascript function, fn1 will close the pop-up window and fn2 will refresh the parent page. And callback fucntion is called in the button click of popup window.
function fn1()
{
this.window.close();
}
function fn2()
{
Refreshpage()//Refreshin the page logic
}
function callback()
{
var callbacks = $.Callbacks();
callbacks.add(fn1);
callbacks.add(fn2);
}
Issue is before closing the popup, page is refreshing (i.e before fn1 finish to execute the code fn2 is executing).
How to make wait till fn1 to finish executing its code, before fn2 starts its execution.