execute javascript method after completing code behind method?
<p>I want execute below callback() method after completion of <code>document.getElementById('btnDownload').click();</code> method . Now <code>callback()</code>executing immediatly. I want wait "Click()" process done then Execute  <code>callback();</code> method.</p>

<pre><code>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");
</code></pre>

<p>}</p>
