title: Cannot pass json data to Ajax function
body: <p>based on below code, i want to understand why i cannot call data from json (<code>json.projects[i].projName</code>) when i am calling it from ajax function?</p>
  
  <pre><code>var json = JSON.parse(data);
  
  for (var i = 0; i &lt; json.projects.length; i++) {  
  
  alert(json.projects[i].projName); //will show correct data
  
      $.ajax({ url: epridlist, method: 'GET'}).then(function (datas) {
          alert(json.projects[i].projName) // this will fail. says not know projName, when projName existed in jason data
      });
  }
  </code></pre>
  
  <p>Please help me understand. if i alert outside ajax function, result will show</p>