Currently I'm pushing new objects into an array within a $.each() loop. Most of the time the array loads all of the objects, but randomly it only loads some of them. For example, it might load the objects from both elements in AddtionalUrls, but then it might only load the first one. It seems random, depending on how fast the data is loading.
var macArray = [];
$(document).ready(function() {
loadMac();
});
function loadMac() {
var AdditionalUrls = ['/_vti_bin/ListData.svc/MACCalendar','/_vti_bin/ListData.svc/QlarantCalendar'];
$.each(AdditionalUrls, function(i,v) {
$.ajax({
url: v,
type: "GET",
data: {
$select: "title"
},
headers: {
accept: "application/json;odata=verbose"
},
success: function(data) {
$.each(data.d.results, function() {
currObj = this;
macArray.push({ title: this.title )};
});
});
)};
}