有哪些方法可以识别用户的地理位置并向他们显示?
我想向我的用户显示他们访问我的页面时的当前地理位置,类似于 Groupon 的做法。
我找到了一个使用 HTML5 执行此操作的选项,但这与我想要支持的所有浏览器不兼容。
有哪些选项可以提供此功能?
I would like to display to my users, similar to how Groupon does it, their current geo location when they come to my page.
I have found an option to do this with HTML5, but that is not compatible with all the browsers I want to support.
What options are there for providing this functionality?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我见过的所有地理位置解决方案都与服务器端代码相关联,该代码获取用户 IP 地址并在可用 IP 之一中查找它。地理位置地图数据库。
此过程的第一步是访问 Quova 然后将其集成到您的系统中。
一旦您知道他们的位置,您就可以将其与 IP 地址一起写入 cookie。当他们访问网站时加载 cookie 并将其与他们的 IP 地址进行比较。如果两者不同,则执行新的地理位置查找。
All geo location solutions I have seen are tied to a server side code, which takes the users IP address and looks it up in one of the available IP <-> geographic location mapping databases.
The first step in this process would be to get access to a service like Quova and then integrate it into your system.
Once you know their location, you could write it to a cookie along with their IP address. Load the cookie when they come to the site and compare it to their IP address. If the two differ, perform a new geo location lookup.