600 CHAPTER 16 Offline web applications
Lesson review
Answer the following questions to test your knowledge of the information in this lesson. You
can find the answers to these questions and explanations of why each answer choice is correct
or incorrect in the “Answers” section at the end of this chapter.
- Which of the following features is not supported by IndexedDB?
A. Transactions
B. Cursors
C. Indexed
D. SQL - What is the correct method for creating a transaction that will add a new record?
A. var trans = db.transaction(‘authors’, ‘readonly’);
B. var trans = db.transaction(‘authors’, ‘readwrite’);
C. var trans = db.transaction(‘authors’);
D. var trans = db.createTransaction(‘authors’,’readwrite’); - Which object store method retrieves a record by its key value?
A. get(key)
B. find(key)
C. single(key)
D. first(key)
Lesson 3: Working with the FileSystem API
So far, you’ve seen several ways to store user data within the browser, and although you could
use solutions such as data URIs to store larger bits of information (images, text files, and so
on), none is really designed for that type of use and would certainly lead to high performance
costs.
HTML5 has a solution: the FileSystem API. By using the FileSystem API, you can create
directories and files within a sandboxed location on the user’s file system, and this opens the
door to a number of new capabilities that were previously limited to desktop applications.
In this lesson, you learn how to use the FileSystem API to perform common tasks such as
creating and reading files. Although the lesson does not cover every available feature, you
should gain a high-level understanding of what this technology offers.