title: AJAX request variable issue
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2366113/jquery-global-variable-problem">jQuery global variable problem</a>  </p>
  </blockquote>
  
  
  
  <p>I'm doing a jQuery AJAX call and I want to save into a variable the response. However this variable is not having the value of the response outside of the AJAX call function. How can I get the response outside of the AJAX call function?</p>
  
  <p>Example:</p>
  
  <pre><code>var responseText = '';
  $.ajax({
      url: 'clients_handler.php',
      type: 'post',
      data: { action: 'check_email', email: email },
      success: function(data) {
          responseText = jQuery.parseJSON(data);
      }
  });
  console.log(responseText);
  </code></pre>
  
  <p>So from my example <code>responseText</code> will be empty as set before the AJAX function.
  How can i set this variable with the AJAX response value?</p>