title: Cant Use Created Function Outside of Ajax done() Callback
body: <p>I have an jQuery Ajax() request like this</p>
  
  <pre><code>  function loadMarkers() {
        for (var i = 0; i &lt; data.length; i++) {
            var projects = data[i];
            var project = new esri.geometry.Point(projects.Longitude, projects.Latitude);
        }
    }
  
    var req1 = $.ajax({
        type: "POST",
        url: "assets/app/data.php",
        data: data,
        cache: false,
        dataType: "JSON"
    });
  
    req1.done(function (data) {
        loadMarkers();
    });
  </code></pre>
  
  <p>The reason that I am trying to put the function <code>loadMarkers()</code> out id the <code>req1..done()</code> is I need to run 20 request and I don't want to repeat the <code>loadMarkers()</code> block inside all of the request <code>.done()</code> . Instead just call the <code>loadMarkers()</code> inside them but I am getting this error</p>
  
  <blockquote>
    <p>Uncaught ReferenceError: data is not defined</p>
  </blockquote>
  
  <p>can you please let me know how to fix this?</p>