We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
您可以使用 google 地理自动完成 api
http://code.google.com/p/geo-autocomplete /
这将为您提供与谷歌地图上相同的位置自动完成功能。
You can use googles geo autocomplete api
http://code.google.com/p/geo-autocomplete/
This will give you the same auto-complete for locations that you would get on googlemaps.
这看起来为您提供了一种与您正在寻找的解决方案类似的解决方案。如果您将
on_click
事件替换为 Javascriptonkeyup
事件,您应该能够实时检查地址。这是一个快速分步集成指南,描述如何将基于 RapidAddress 邮政编码的地址查找器添加到 HTML 网站。我们建议您首先阅读 JavaScript 用户指南。
步骤#1
从下载部分下载最新版本的 JavaScript 类。您还可以使用集成包,它包含现成的 HTML 页面,可以方便地作为起点。
将 JavaScript 文件 crafty_postcode.class.js 上传到您的网络服务器并在 HTML 中引用它,您可能必须在 src 属性中使用相对或绝对路径:
注意:“ISO-8859-1”位很重要,因为 JS 脚本被压缩。
步骤#2
创建并配置 JavaScript 对象:
步骤#3
在 HTML 中创建地址表单:
注意:“companyname”、“address2/3”和“county”是可选的,如果适合您的网站,您可以忽略这些字段。请记住在步骤 2 中从 JavaScript 配置中也删除它们。例如,如果您不需要县字段: cp_obj.set("elem_county", "");
请注意“查找地址”按钮,onclick 操作调用 doLookup() 方法。
地址结果(或错误消息)将放置在 id="crafty_postcode_result_display" 的元素中。
全部完成!
如果由于任何原因无法正常工作,请将任何错误代码/消息通过电子邮件发送给我们。我们将很乐意提供帮助。如果您还没有阅读过 JavaScript 用户指南,您可能还想阅读。
位于:
http:// /www.craftyclicks.co.uk/web-service/docs/javascript-address-finder-how-to-add-rapidaddress
This looks to give you a solution similar to the one you are searching for. If you replace the
on_click
event with the Javascriptonkeyup
you should then be able to check the address realtime.This is a quick step-by-step integration guide describing how to add a RapidAddress postcode based address finder to a HTML website. We recommend you read the JavaScript user guide first.
Step #1
Download the latest version of the JavaScript class from the downloads section. You could also use the integration pack, it contains ready made HTML pages that may be handy as a starting point.
Upload the JavaScript file crafty_postcode.class.js to your webserver and reference it in your HTML, you may have to use relative or absolute paths in the src property:
NOTE: the "ISO-8859-1" bit is important as the JS script is compressed.
Step #2
Create and configure the JavaScript object:
Step #3
Create an address form in HTML:
NOTE: "companyname", "address2/3" and "county" are optional, you can leave these fields out if it suits your site. Remember to delete also them from the JavaScript config in step 2. For example if you do not want the county field : cp_obj.set("elem_county", "");
Note the 'Find Address' button, the onclick action calls the doLookup() method.
The address results (or an error message) will be placed in the element with id="crafty_postcode_result_display".
All done!
If things don't work for any reason, email any error codes/messages to us. We will be happy to help. You may also want to read the JavaScript user guide, if you haven't already.
As found at:
http://www.craftyclicks.co.uk/web-service/docs/javascript-address-finder-how-to-add-rapidaddress