So trying to get two JSON requests to happen after each other, and seems like the javascript does the first request, but never even attempts the second one.
So, first one asks for colors, the second one asks for values, the code looks like this
(function() {
var mapKeyUrl = "/GenMap/getcountry/mapdata"
$.getJSON(mapKeyUrl, {
regsel: "${regsel}",
variable: "mapcolor"
})
.done(function( coldata ) {
console.log( "JSON Data: " + coldata[1].value );
(function() {
mapKeyUrl = "/GenMap/getcountry/mapdata"
$.getJSON(mapKeyUrl, {
regsel: "${regsel}",
variable: "mapkey"
})
.done(function( mapdata ) {
console.log( "JSON Map:" + mapdata)
})
})
});
})();
Both requests return valid JSON data, so mapcolor for example:
[{"class":"genmap.Mapconf","id":55,"map":"0","reg":"FATCA","value":"#F0F0F0","variable":"mapcolor"},{"class":"genmap.Mapconf","id":56,"map":"1","reg":"FATCA","value":"#66CCFF","variable":"mapcolor"},{"class":"genmap.Mapconf","id":57,"map":"2","reg":"FATCA","value":"#0000FF","variable":"mapcolor"},{"class":"genmap.Mapconf","id":58,"map":"3","reg":"FATCA","value":"#CC66FF","variable":"mapcolor"},{"class":"genmap.Mapconf","id":59,"map":"4","reg":"FATCA","value":"#9900CC","variable":"mapcolor"},{"class":"genmap.Mapconf","id":60,"map":"5","reg":"FATCA","value":"#7D7D7D","variable":"mapcolor"}]
And mapkey returns a similar list.
Any suggestions, need to run three of these, and one I have all the data I need to recombine it.
failcallback in your first call. Try adding one})();with the()to call it, but at the end of the inner function you just have})