I'm planning a site where content on the landing page is determined by the geographical location of the user. The accuracy doesn't need to be pinpoint, within a UK post code would be perfect le开发者_StackOverflow社区ss accurate isn't a huge problem. I'm looking at cross-browser compatibility here mainly. Any thoughts?
Try html5 Geo Location: http://diveintohtml5.ep.io/geolocation.html
Here is a demo page which you can take the code from: http://html5demos.com/geo
If you're looking for a server-side solution, I recommend GeoIP/GeoLite from MaxMind. It has a clean, simple, and efficient API, although its primary documentation seems to be just in the the header files. If you want more accuracy later, the paid version of the database can be substituted for the free version simply by replacing the database file (without code changes).
精彩评论