How to call an event handler dynamically and get its return value in javascript?
<p>I asked a question yesterday, I accepted the answer, but sometime later, I came to know that the solution was not complete. The question is :-</p>

<p><a href="http://stackoverflow.com/questions/6996830/insert-a-jquery-click-handler-that-executes-before-the-ones-already-registered">Insert a JQuery click handler that executes before the ones already registered</a></p>

<p>using <code>setTimeout(handler,0);</code> returns immediately and I can not use <code>return setTimeout(handler,0);</code>. How can I run this <code>handler</code> synchronously and not allow the parent function to complete until this handler is completely executed and I get the return value out of it ?</p>

<p>I am in hurry, so I am asking it again, rather than editing that question again.</p>
