What s the best way to get a json response into an array that I can use in the below example? This is my function that calls triggers the ajax call:
function getMaps(){
mapID = "aus";
mapImg = map_australia.jpg ;
$.ajax({
type: "GET",
url: "getMap.asp",
data: "id=" + mapID,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(response) {
//not sure what to do here
}
});
return //not sure what to return here
// it should resemble: return {id: aus , image: /resources/images/maps/map_australia.jpg , data: , maps: []};
};
为了测试目的,从中转来:
{ j :[{ id : aus , image : /images/maps/map_detail.jpg , data : , maps :[]}]}