Waiting for $.post answer
<p>I'm checking if the entered login is already registered in my database using ajax function below...</p>

<pre><code>function freelog(login) {
    var data = {login:login};
    $.post ('freelog.php', data, function(response){
            if(response == '1') {
                freelogin = true;
            } else if(response == '0') {
                freelogin = false;
            } else {
                freelogin =  response;
            }
    });
    return freelogin;
}
</code></pre>

<p>Of course I have a problem with the line:</p>

<pre><code>return freelogin;
</code></pre>

<p>The reason is that $.post need some time to answer... I have no idea how to solve this prroblem... Hope, You'll help me :)</p>
