title: jQuery ajax return value
body: <p>How can I return the value "<strong>pinNumber</strong>" from jquery ajax so I can append it outside of the ajax. Here is my code</p>
  
  <pre>
  var x = pinLast + 1;
      for(i=x;i&lt;=pinMany;i++) &#123;
          var i = x++;
          var cardNumber = i.toPrecision(8).split('.').reverse().join('');
          var pinNumber = '';
  
          jQuery.ajax(&#123;
              type: "POST",
              url: "data.php",
              data: "request_type=generator",
              async: false,
              success: function(msg){
                  var pinNumber = msg;
                  return pinNumber;
                  //pin number should return
              }
          });
  
          jQuery('.pin_generated_table').append(cardNumber+' = '+pinNumber+'<br />');
          // the variable pinNumber should be able to go here
  
      }
  </pre>
  
  <p>Please ask me if you don't understand.. ^^ thanks</p>