在浏览器中确定用户地理位置的最准确方法是什么?

发布于 2024-08-25 07:56:42 字数 366 浏览 6 评论 0原文

我发现了一些建议使用 Google AJAX API 的示例。

此链接代表了我迄今为止找到的建议:http://briancray.com/2009/05/29/find-web-visitors-location-javascript-google-api/

但是,Google API 的位置经常是错误的。

不过,其他网站似乎确切地知道我在哪个城市,而无需我输入任何信息。

建议?有没有跨浏览器(忽略IE6)并且可靠的东西?

I found a few examples suggesting Google AJAX APIs.

This link typifies the advice I have found so far: http://briancray.com/2009/05/29/find-web-visitors-location-javascript-google-api/

However, the location is often wrong with the Google APIs.

Other sites seem to know exactly which city I'm in, though, without me entering any information.

Suggestions? Is there something cross-browser (ignoring IE6) and reliable?

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

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

发布评论

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

评论(4

日久见人心 2024-09-01 07:56:42

我本打算回答几个问题,但有时参考一篇不错的文章是正确的选择。我最近看到了 Christian Heilmann 撰写的《Smashing Magazine》文章,其中解释了有关地理定位的所有问题、解决方案和更多信息。

进入地理定位的奇妙世界

I was going to answer with a few points but sometimes referencing a decent article is the way to go. I recently came across this Smashing Magazine article by Christian Heilmann which explains the issues, solutions and further info on all things GeoLocational.

Entering the wonderful world of Geolocation

大海や 2024-09-01 07:56:42

检查 http://hostip.info
它是一个开源数据库。

check http://hostip.info
it is an opensource database.

不…忘初心 2024-09-01 07:56:42

除了昂贵的 GeoIP 数据库有限的 js api(在 smash 文章 Brian 链接) MaxMind 还提供许多免费的 Geolite DB 供下载。

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

它们可以在 此许可证

Other that the costly GeoIP database and the limited js api, (cited in the smash article Brian linked) MaxMind also offers a number of free Geolite DBs, for download.

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

They are redistributable under this license.

小…楫夜泊 2024-09-01 07:56:42

如果浏览器没有实现 navigator.geolocation API,请尝试 Webshims 地理定位模块支持它。

Try Webshims geolocation module it implements navigator.geolocation API if browser doesn't support it.

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