我期待自動填充表單輸入textarea與用戶的城市,州。我還需要郵政編碼與表格一起傳遞。我不需要地圖。jQuery和/或PHP位置查找器:郵政編碼和城市/州
有什麼建議嗎? (我喜歡jQuery和/或PHP)
UPDATE - 我 發現這個小JS獲得市,州,緯度,經度,地區代碼,等等......除了它沒有得到的zip 。可能是因爲很多城市有多個拉鍊。但我需要的只是一個城市的拉鍊......哪一個並不重要,因爲我在50英里範圍內抓取數據。因此,無論如何,請在下面使用此腳本,並根據它返回的數據找到該位置的zip。
<html>
<head>
<script language="JavaScript" src="http://www.geoplugin.net/javascript.gp" type="text/javascript"></script>
</head>
<body>
<script language="Javascript">
document.write("Welcome to our visitors from "+geoplugin_city()+", "+geoplugin_region()+", Area code = "+geoplugin_areaCode()+", Latitude = "+geoplugin_latitude()+geoplugin_areaCode()+", Longitude = "+geoplugin_longitude());
</script>
</body>
</html>
來源:GeoPlugin
頁面已經PHP驅動,所以服務器端腳本是好的。另外,我並不擔心代理或腳本失敗,因爲用戶總是可以輸入城市。 – Jeffrey 2011-04-02 22:18:41
上面的鏈接無法正常工作。我在Firefox中收到一條消息,說htm5demos想知道你的位置。你不想提示用戶這些問題 – vsingh 2011-04-13 20:22:24