I'm fetching an XML file using this code:
function getMaps(){
toLoad = loadMaps.length;
for (var i = 0; i < loadMaps.length; i++){
$.ajax({
type: "GET",
url: loadMaps[i],
dataType: "xml",
success: processMap
});
}
}
Which works fine, but I want to give processMap another parameter (namely loadMaps[i], the name under which to store the loaded xml)
I can't figure out how to do this without resorting to global variables, which is not what I want.