This is self-evident:
while (...) {
var string='something that changes for each ajax request.';
$.ajax({'type': 'GET','dataType': 'json', 'url': 'get_data.php'}).done(processData);
}
function processData(data) {
}
As you can see, I need to somehow get stringin processData. I cannot create a global variable because it stringis different for every ajax request. So the question is, how do I bind stringajax to my request so that I can access it from processData?
I really do not need to add stringto the request and return the server, but if this is my only option, I have no choice.
Thanks in advance.
source
share