title: jQuery using outside variables inside a callback function
body: <p>Ok this is what I have until know:</p>
  
  <pre><code>function validate() {
  var validated = true;
  
  $('.alert-infobox').fadeIn("fast", function(){
     $('input.offer').each(function(){
         // do ajax code with async = false for each input for validate if something happens
         validate = false;
     });
  });
  
  }
  
  if(validated){
     //do something
  }
  
  return validated;
  </code></pre>
  
  <p>Now what im trying to do is to fade in and after the fade in run for each input an ajax call to verify an input in server side, now the variable validated always stay true, I believe the instruction inside the callback in the fadeIn is in different scope, is there a way to access the variable outside the callback function ?</p>
  
  <p>Sorry kind of  new here :)</p>
  
  <p>Thanks</p>