HTML and CSS Reference
Christopher Deutsch and Marc Grabanski
The W3C Geolocation API allows for scripted access to geographical location infor-
mation associated with a device's browser. In this chapter we'll first cover how to access
this API and then dive into some examples of what you can do with this data using
Google Maps and other third-party libraries like SimpleGeo.
be included using a script tag in one of two ways. There is no need to download the
jquery.js file; your web page can use the version hosted on Google's Content Delivery
And, just in case a call to the file across the Internet isn't available, a fallback to a local
copy of the jQuery file can come right afterward in a second script element that checks
for the previous copy's successful inclusion:
<script>window.jQuery || document.write("<script
8.1 Getting Basic Geolocation Data
You want to find the location of the user's Internet device.
Use the new HTML5 Geolocation API to get the user's location when she clicks a button
and output the values to the web page, as shown in Figure 8-1 .