Hello
I have a a loop processing $.get statement inside it. The $.get returns value from controller function. as follows:
res = null;
for (key in data.Results) {
var url = "/Search/Get_ManID?MakeName=Test";$.get(url, function (data) {
res = data; // it will get some value , data = 148
}
alert(res);It will alert null instead of the value that it will hold.
The issue is that the alert statement will run before the $.get function.
How can I control the order of code running.