title: extract the ajax response in jQuery?
body: <p>How can i extract the returned response of the ajax response? to catch the response i should write:</p>
  
  <pre><code>$.post('server.php',{x : 9}, function(response){
      alert(response);
  });
  </code></pre>
  
  <p>Now, how can i take the " response " out of the function(){} ?, because it doesn't exist outside .. and i wanna compare it with some other value, i attempted to assign it to a global var and to a jQuery object " $response ", but it always "undefined" while the " response " it self have the correct value !.. 
  Generally  i want it this way, if possible :)</p>
  
  <pre><code>response= $.post('..',{.. : ..});
  </code></pre>
  
  <p>Thanks in advance :)</p>