execute javascript method after method excution complete ?
- by James123
I want execute below callback()method after completion of  process document.getElementById('btnDownload').click(); method. click() is the code behind method. That means, I mean after complete process of click() then excute callback() method.
Because my modelpop is not hiding in code behind. So I want hide in javascript method.
function LoadPopup() { 
    //  find the popup behavior 
    this._popup = $find('mdlPopup'); 
    // show the popup 
    this._popup.show(); 
    // synchronously run the server side validation ... 
    document.getElementById('btnDownload').click(); 
   callback();          
} 
 function callback() { 
    this._popup = $find('mdlPopup'); 
    //  hide the popup 
    this._popup.hide(); 
    alert("hi"); 
}