Training Guide: Programming in HTML5 with JavaScript and CSS3 Ebook
Lesson 2: Working with IndexedDB CHAPTER 16 599 index.openCursor(IDBKeyRange.lowerBound('Defoe', true)); results: Herman Melvill ...
600 CHAPTER 16 Offline web applications Lesson review Answer the following questions to test your knowledge of the information i ...
Lesson 3: Working with the FileSystem API CHAPTER 16 601 After this lesson, you will be able to: ■■Describe the use of the FileS ...
602 CHAPTER 16 Offline web applications Creating and opening a file To create a file, you must first have a DirectoryEntry objec ...
Lesson 3: Working with the FileSystem API CHAPTER 16 603 window.requestFileSystem(TEMPORARY, 5 * 1024 * 1024, getFile, handleErr ...
604 CHAPTER 16 Offline web applications fileReader.onerror = function() { alert('Failed'); }; fileReader.readAsText(file); } fun ...
Lesson 3: Working with the FileSystem API CHAPTER 16 605 function directoryOpened(directoryEntry) { alert(directoryEntry.fullPat ...
606 CHAPTER 16 Offline web applications function directoryOpened(directoryEntry) { directoryEntry.remove(directoryRemoved, handl ...
Lesson 4: Working with the offline application HTTP cache CHAPTER 16 607 C. window.requestFileSystem(SIMPLE, 5 * 1024 * 1024, ge ...
608 CHAPTER 16 Offline web applications Browser support The application cache is now supported in the latest version of all majo ...
Lesson 4: Working with the offline application HTTP cache CHAPTER 16 609 FALLBACK: /Content/Images/Products/ /Content/Images/off ...
610 CHAPTER 16 Offline web applications Understanding events In general, the application cache process occurs silently, but the ...
Practice exercises CHAPTER 16 611 ■■Items that can operate only when a network connection is present should be listed in the NET ...
612 CHAPTER 16 Offline web applications The names of the IndexedDB variables with which you’ll need to work vary across dif- fe ...
Practice exercises CHAPTER 16 613 ? contacts.put(contact, currentRecord.key) : contacts.add(contact); request.onsuccess = functi ...
614 CHAPTER 16 Offline web applications Because the results array that’s passed to the bindToGrid method contains objects that a ...
Practice exercises CHAPTER 16 615 }; function retrieveFromStorage() { var contactsJSON = localStorage.getItem('contacts'); retur ...
616 CHAPTER 16 Offline web applications displayCurrentRecord(); }; }; function displayCurrentRecord() { var contact = currentRec ...
Answers CHAPTER 16 617 Answers This section contains the answers to the lesson review questions in this chapter. Lesson 1 Corre ...
618 CHAPTER 16 Offline web applications Correct answer: B A. Incorrect: An exception is thrown if a write action such as adding ...
«
26
27
28
29
30
31
32
33
34
35
»
Free download pdf