I\'m building a web application that needs to make about 28000 database calls using the jquery ajax shortform all at once.
It gets through about 6000 of the calls fi
You could do something like this.
function findIdealPoints(data){
var i = 0;
while (i < data.length){
loadAspectWithinRange('aspect', data[i]['lat'], data[i]['long'], 10,
compareWithAspect);
i++;
}
Instead of doing an Ajax call for each occurrence send the data object to your call
loadAspectWithinRange('aspect',data,10,compareWithAspect)
Then in the Ajax request send the array of objects to your service and retrieve the results for all of them instead of one by one.
$.ajax({
url:"...",
data:{
attr1:'aspect',
points: data(here is the array retrieved from "getIdealData.php")
attr2: 10
},
success:function(data){
compareWithAspect(data)
}
})
In the server side processing build an array of the objects for all the element on the getIdealData.php
points.
This will be better instead of doing an Ajax for each element