0
var addressArr = new Array();
....
for(var i=0;i<addressArr.length;i++){
geocoder_map.geocode({ 'address': addressArr[i]}, function(results, status) {
alert(addressArr[i]); // here i found undefined - how i will find this value here ?
});
}
我已經stroing值隱藏字段試圖也想..如何將全局變量值轉換爲geocoder_map.geocode(..)函數?
var addressArr = new Array();
....
document.getElementById("hidAddressStr").value = addressArr[i];
for(var i=0;i<addressArr.length;i++){
geocoder_map.geocode({ 'address': addressArr[i]}, function(results, status) {
alert(document.getElementById("hidAddressStr").value); // i found only single value from here
});
}