title: Ajax Jquery: how return result?
body: <p>In script-a.js I have this function:</p>
  
  <pre><code>function callGetAjax(url,callback) {
         $.get(url, {}, function(result) {
             // this will call the callback and pass the result
             callback(result); 
         });
  }
  </code></pre>
  
  <p>In script-b.js I call it:</p>
  
  <pre><code>var url = '/feed/location';
  callGetAjax(url,function(result)
  {
      //console.log(result); &lt;= of course this logs right
      data = result;
      return data;
  });
  console.log(result); // &lt;= ReferenceError: result is not defined
  console.log(data); // &lt;= ReferenceError: data is not defined
  </code></pre>
  
  <p>I don't want make <code>async:false</code> but I need to "export" data to elaborate it. Thank you.</p>