Pinpoint users' locations via JavaScript and the Web's Geolocation API

By John Duckett, Computerworld |  Software, Geolocation, insider

You've probably visited websites where you've been asked to share your location; if you agree, the site determines where you are and then typically gives you extra functionality such as directions or local weather.

Sites can pinpoint your location (if you give permission) by implementing the Geolocation API, a standard adopted by the World Wide Web Consortium that's available on recent versions of platforms including IE, Firefox, Safari, Chrome, Opera, iOS and Android.

In this PDF download, you'll see how just a few lines of JavaScript are needed to discover a user's location. (This PDF is excerpted with permission from the publisher, Wiley, from JavaScript & jQuery: Interactive front-end Web development by John Duckett. Copyright 2014 all rights reserved.

To continue reading, register here to become an Insider. You'll get free access to premium content from CIO, Computerworld, CSO, InfoWorld, and Network World. Go now!


Originally published on Computerworld |  Click here to read the original story.
Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Answers - Powered by ITworld

Ask a Question
randomness