jQuery $.post not completing when called
<p>I have the following function which I use to check whether or not an email address is already registered.</p>

<pre><code>checkTaken() {
  var email_var = $('input#email').val();

  $.post("../includes/check_email.inc.php",{email:email_var} ,function(data) {
      var ret = data + "";
    if(ret=="true") {//if username not avaiable
      $('div#emailTaken').show();
      $('input#email').addClass('redBack');
      return false;
    } else {
      $('div#emailTaken').hide();
      $('input#email').removeClass('redBack');
      return true;
    }
  });
} 
</code></pre>

<p>When I call it using something like the following it works fine:</p>

<pre><code>email.blur(checkTaken);
</code></pre>

<p>But when I do something like</p>

<pre><code>var test1 = checkTaken();
</code></pre>

<p>or</p>

<pre><code>if(chekTaken) {
</code></pre>

<p>something quirky happens. It enters the function, executes the $.post line, but then never enters the rest of the routine. Why is this? And how do I fix it?</p>

<p>As a note, when I call the function using the last two examples, I do get information back from the server as <a href="http://dl.dropbox.com/u/93529/consol.png" rel="nofollow">seen through firebug</a>.If I add a watch for test1, it remains undefined.</p>
