So having an absolute nightmare reading a JSON reply Whatever I do I get either a list of object Object, undefined or other issue, but I can not get the actual information out of the JSON reply, but there is a JSON reply. What am I missing. The JSON call looks like this
var mapKeyUrl = "/GenMap/getcountry/jsonchk";
var mapKeyUrl = "/GenMap/getcountry/jsonchk"
$.getJSON(mapKeyUrl, {
regsel: "${regsel}",
countryiso: code
})
.done(function( contdata ) {
alert(contdata)
contdata = contdata.country
alert(contdata)
document.getElementById("maptext").innerHTML = "I am an abwrock " + code + contdata.exturl;
})
The response (as taken from the chrome debug) looks as follows
{"country":
[
{"ccode":["EG"]},
{"cname":["Egypt"]},
{"exturl":["N/A"]},
{"impdate":[null]},
{"lupdate":["2014-09-28T23:00:00Z"]},
{"impnote":[null]}
]
}