title: jQuery return ajax result into outside variable
body: <p>I have some problem using ajax.</p>
  
  <p>How can I assign all result from ajax into outside variable ?</p>
  
  <p>I google it up and found this code..</p>
  
  <pre><code>var return_first = (function () {
      var tmp = null;
      $.ajax({
          'async': false,
          'type': "POST",
          'global': false,
          'dataType': 'html',
          'url': "ajax.php?first",
          'data': { 'request': "", 'target': arrange_url, 'method': method_target },
          'success': function (data) {
              tmp = data;
          }
      });
      return tmp;
  });
  </code></pre>
  
  <p>but not work for me..</p>
  
  <p>Can anybody tell what is wrong about that code ?</p>