$.getJSON("http://localhost:8080/geoserver/Tourism/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=Tourism:geot_alldata_utm1&maxFeatures=5000&outputFormat=application%2Fjson", function(result){
var i;
for(i = 0; i < 200; i++){
var img = (result["features"][i]["properties"]["image"]);
var temp =(result["features"][i]["properties"]["class"]);
type.push(temp);
images.push(img);
}
});
console.log(type[0]);
我已经编写了上面的代码来将JSON对象中的特定值存储到我声明的两个全局数组中。但我无法通过添加到数组的索引访问变量。