查找客户的大致物理位置

发布于 2024-12-29 07:47:54 字数 318 浏览 6 评论 0原文

有没有办法用 Jquery 找到客户端的物理位置?我已经找到了如何获取他们的 IP 地址,并且如何使用 geoplugin 对他们的位置进行地理编码,但我想知道是否还有其他方法可以做到这一点?我不需要确切的位置。只需足够近似即可了解他们所处的状态,以便在进入实际状态之前估计税率。这可能吗?

Is there a way to find where a client is located physically with Jquery? I have found how to get their IP address, and also how to geocode their location with geoplugin, but I am wondering if there are other ways to do this? I don't need an exact location. Just approximate enough to know what state they are in to estimate a tax rate before they enter their actual state. Is this possible?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

懵少女 2025-01-05 07:47:54

使用 IP 地址进行地理定位(根据您已经在做的事情)是迄今为止最传统的方法 - 有一个新的 W3C 标准——但是它会提示人们获得许可(请参阅演示 此处),以及针对设备的如果没有嵌入式 GPS(例如 iPhone/Android),则必须利用服务器端服务进行 wifi 和/或 ip 地理定位——事实上,它会提示用户,这意味着它可能不适合您想要做的事情。

较大的网站将使用跟踪 cookie 来允许网站查找用户在之前访问时提供的数据 - 因此,如果您已经获得了客户之前访问时提供的送货地址,您可以使用他之前提供的邮政编码您的销售税估算。

Using IP address for geolocation (as per what you are already doing) is by far the most traditional way of doing it -- there are a new W3C standard -- however it will promp people for permission (see demo here), as well as it for devices without embedded GPS (e.g. iPhone/Android) will have to draw on server side services for wifi and/or ip geolocation -- the fact that it will propt users means that it is probably not suitable for what you want to do.

Bigger website will use a tracking cookie to allow the site to lookup data the user have provided at previous visits -- so if you already have the shipping address from a customer from a previous visit, you can use the zip code which he provided earlier for you sales-tax estimation.

屋顶上的小猫咪 2025-01-05 07:47:54

http://www.maxmind.com/app/javascript_city

包含 JS 文件 http://j.maxmind.com/app/geoip.js &根据IP获取位置。

(它不是完全免费的,请参阅网站。)

http://www.maxmind.com/app/javascript_city

Include the JS file http://j.maxmind.com/app/geoip.js & get location based on IP.

(Its not completely free, see website.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文