I have found the issue however my solution does not work. The variables d0 and d1 get populated but after the code creates and splices the array storelocations. Therefore, I get an error that d0 and d1 is undefined. Any solutions? thx for the help
Javascript:
$(function () {
$.get("/Map/GetJsonData", function (data) {
storeLocations = [];
var d0 = data[0].Delay;
var d1 = data[1].Delay;
});
var storeLocations = new Array();
storeLocations.splice(storeLocations.length, 0, d0);
storeLocations.splice(storeLocations.length - 1, 0, d1);
}
console.log(data)
as the first line of your callback function what does it show?Clinics
is filled up correctly or are you missing something on url (may be ../Map/GetJsonData), try using$.get("/Map/GetJsonData", function (data) {})
, this may not solve your issue but saves some cycles.