Wait for click event to complete
<p>I add click events handler to elment</p>

<pre><code> $(".elem").click(function(){
       $.post("page.php".function(){
         //code1
      })
 })
</code></pre>

<p>And trigger click event</p>

<pre><code>$(".elem").click();
//code2
</code></pre>

<p>How i make sure that code2 executes after code1 executes</p>
