我注意到,在FF4中,我可以使用地理定位對象 position.address.postalCode來查找郵政編碼。browser position.address.postalCode always null
當在FF10上測試時,我發現位置地址總是爲空,而我仍然可以使用position.coords而沒有任何問題來查找經度或緯度。
有人可以告訴我,如果有簡單的方法找到FF10中的位置對象postalCode?
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(findClosestAgencies);
}
function findClosestAgencies(position) {
alert("postalCode:" + position.address.postalCode);
alert("latitude:" + position.coords.latitude);
}
我的代碼:
謝謝
請提供您的代碼的示例不工作... – ehudokai 2012-02-28 17:19:56
此代碼不適用於FF10。 position.address is null [Break On This Error] \t alert(position.address.postalCode); – gospodin 2012-02-28 17:37:23