return function value from $.post callback
<p><strong>js:</strong></p>

<pre><code> function verificaExistPed(numped){
        var valida;
        jQuery.post("procedures/class_oc.php", // ajax post
            {
                cache      : false,
                checkYear  : true,
                numped     : numped
            },
            function(data)
            {
                if(data === "s"){
                    valida = true;
                }else{
                    valida = false;
                }
            }
        )
        return valida;
  }
</code></pre>

<p>and, calling the function in another place, should return <code>valida</code> result inside variable <code>check</code>, in my case, <code>true</code> or <code>false</code>.</p>

<pre><code>var check = verificaExistPed('".$numped."');
alert(check); // always undifined
</code></pre>

<p>but, always undefined.</p>

<p>how can i set <code>valida</code> to <code>true</code> or <code>false</code> from a <code>$.post</code> callback ? </p>
