HTML and CSS Reference
In-Depth Information
A P P E N D I X
Associated Technologies
In addition to CSS3, a number of technologies have been associated with HTML5 but ac-
tually are defined in their own specifications. Some were once part of HTML5 but have
been spun off into their own documents as they have grown, while others are directly used
with HTML5 but were never part of the HTML5 specification. This appendix provides
a high-level overview of these different technologies that are commonly associated with
HTML5. Additionally, you will also find a list of useful website resources for working
with HTML5 at the end of the chapter.
Geolocation
The Geolocation API 1 defines how a web browser can determine a user's geographic loc-
ation, using their IP or WiFi address or, if they are on a mobile device, the Global Pos-
itioning System (GPS) on the device. The location is given as a latitude and longitude
coordinate, which may be more or less accurate, depending on the method used in retriev-
ing the location. Determining a user's location with their IP address, for instance, will be
far less accurate than using the satellite-based GPS to determine their location.
The implications of retrieving a user's location are quite fascinating, because it enables
location-based services to be provided through a web browser. This is perhaps most use-
ful for mobile devices, because information and advertisements can be delivered to a web
browser on a device that is on the move.
The JavaScript methods for retrieving a user's location are held in the Geolocation
object, which is inside window.navigator.geolocation . The location can be re-
trieved one time or can be updated continuously. The API defines three methods:
getCurrentPosition() : Retrieves the current position one time
watchPosition() : Retrieves and updates the current position as it changes
clearWatch() : Stops updating a watched position
Search WWH ::




Custom Search