title: Get data from callback and return to global variable
body: <p>i'm trying to get data from a callback, and puts this data in a global variable, like this.</p>
  
  <pre><code>var x;
    CartolaRutAccountAJAXFacade.getCargarValores(dwr.util.byId('combo').value, function(data){
      x = data;
    });
  
  console.log(x);
  </code></pre>
  
  <p>In console log i'm getting undefined.
  If i execute x after few seconds, i get the right data.</p>
  
  <p>What i do i have to do? Thank's guys.</p>
  
  <p>PD: I'm doing this from capybara execute_script for scraping reasons, so i need return x for get the data with evaluate_script.</p>