</div>
</div>
<div class="grid--cell mb0 mt4">
<a href="/questions/14220321/how-do-i-return-the-response-from-an-asynchronous-call" dir="ltr">How do I return the response from an asynchronous call?</a>
<span class="question-originals-answer-count">
(38 answers)
</span>
</div>
<div class="grid--cell mb0 mt8">Closed <span title="2014-02-20 11:58:24Z" class="relativetime">6 years ago</span>.</div>
</div>
</aside>
How can I get imageX show it's value when used outside of $.ajax()?
var imageX;
$.ajax({
type: 'GET',
url: 'php/my1.php',
dataType: 'json',
async: 'false',
success: function(response){
imageX = response[0].studentName,
groupX = response[0].subjectId;
}
});
alert(imageX);
</div>