我收到以下錯誤做天氣預報錯誤,而使用谷歌地圖API
Uncaught Error: Invalid value for property <address>:
下面是做地理編碼代碼:
function codeAddress(zipcode){
var address = zipcode;
alert("Address is: " +address);
geocoder.geocode({ 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({
map: map,
position: results[0].geometry.location
});
} else {
alert("Geocode was not successful for the following reason: " + status);
}
});
}
功能需要一個參數「郵編」從下面的代碼:
<input type="button" value="Geocode" onclick="codeAddress(<%=resultset.getString(3)%>)">
請幫我在這。
什麼是resultset.getString(3)? – aProgrammer 2012-01-05 05:25:26
欲瞭解更多信息,請參閱我給出的答案在http://stackoverflow.com/questions/8679118/how-to-find-lat-long-of-a-given-area-using-pin-code/8710888#8710888 – aProgrammer 2012-01-05 05:27:07
@amit resultset.getString(3)表示我從SQL數據庫獲取郵編的值。 – 2012-01-05 05:30:27