title: jquery: why i can't return boolean in function
body: <p>i have current code:</p>
  
  <pre><code>&lt;button onclick="ismeloggedin()"&gt;
  </code></pre>
  
  <p>script:</p>
  
  <pre><code>function ismeloggedin(){
      if(checkloggedin()){
          alert('you"re logged in');
      }else{
          alert('you didn"t login!!!!');
      }
  }
  
  function checkloggedin(){
      $.post('/test/check/',{'loggedin':0},function(data,status){
          return (data.status == 'error')?false:true; 
      });
  }
  </code></pre>
  
  <p>php is not necessary but post anyway</p>
  
  <pre><code>function check(){
      is(isset($_POST['loggedin'])){
          if(isLoggedIn()){
              $json = ['status'=&gt;'success'];
          }else{
              $json = ['status'=&gt;'error'];
          }
          header('Content-Type: application/json; charset=utf-8');
          echo json_encode($json);
      }
  }
  </code></pre>
  
  <p>i got the issue is <code>checkloggedin()</code> this function return <code>undefined</code></p>
  
  <p>instead return true/false</p>