Training Guide: Programming in HTML5 with JavaScript and CSS3 Ebook
539 Chapter 14 Making your HTML location-aware CHAPTER 14 Making your HTML location-aware T he Geolocation application programmi ...
540 CHAPTER 14 Making your HTML location-aware Before you begin To complete this book, you must have some understanding of web d ...
Lesson 1: Basic positioning CHAPTER 14 541 ■■timestamp Gets the time that the Coordinates object was created. The format for the ...
542 CHAPTER 14 Making your HTML location-aware $(document).ready(function () { getLocation(); }); function supportsGeolocation() ...
Lesson 1: Basic positioning CHAPTER 14 543 Handling errors You must handle errors when calling methods on the Geolocation object ...
544 CHAPTER 14 Making your HTML location-aware In this example, the showError function is called if there is an error when calli ...
Lesson 1: Basic positioning CHAPTER 14 545 ■■maximumAge pecifies that a cached location is acceptable as long as it’s no older S ...
546 CHAPTER 14 Making your HTML location-aware Lesson review Answer the following questions to test your knowledge of the inform ...
Lesson 2: Monitored positioning CHAPTER 14 547 <head> <title></title> <link href="GeoLocation.css" rel="sty ...
548 CHAPTER 14 Making your HTML location-aware var datetime = new Date(position.timestamp).toLocaleString(); showMessage("Latitu ...
Lesson 2: Monitored positioning CHAPTER 14 549 return distance; } function getRadians (latlongDistance) { return latlongDistance ...
550 CHAPTER 14 Making your HTML location-aware Practice exercises If you encounter a problem completing any of these exercises, ...
Practice exercises CHAPTER 14 551 Under the element, add another element whose id is message. Your HTML page should look like ...
552 CHAPTER 14 Making your HTML location-aware showMessage("Geolocation is not supported by this browser."); } } function suppor ...
Suggested practice exercises CHAPTER 14 553 the Google API to create a coordinate object based on latitude and longitude, and it ...
554 CHAPTER 14 Making your HTML location-aware Answers This section contains the answers to the lesson review questions in this ...
555 CHAPTER 15 Local data with web storage S o far, you’ve learned how to take advantage of a wide array of tools to produce app ...
556 CHAPTER 15 Local data with web storage After this lesson, you will be able to: ■■Understand web storage. ■■Implement the loc ...
Lesson 1: Introducing web storage CHAPTER 15 557 $.cookie('firstName', 'Glenn'); var firstName = $.cookie('firstName'); This exa ...
558 CHAPTER 15 Local data with web storage Looking beyond plug-ins Although the features within these plug-ins provided great an ...
«
24
25
26
27
28
29
30
31
32
33
»
Free download pdf