Training Guide: Programming in HTML5 with JavaScript and CSS3 Ebook

(Nora) #1

Answers CHAPTER 16 617


Answers


This section contains the answers to the lesson review questions in this chapter.

Lesson 1



  1. Correct answer: A
    A. Correct: Because iOS web applications can target Safari’s mobile browser specifi-
    cally, you can be sure that Web SQL will be available.
    B. Incorrect: Not all mobile browsers support Web SQL and therefore should be
    avoided.
    C. Incorrect: Not all desktop browsers support Web SQL and therefore should be
    avoided.
    D. Incorrect: Internet Explorer does not support Web SQL.

  2. Correct answer: D
    A. Incorrect: A createDatabase() command does not exist in Web SQL.
    B. Incorrect: A new database cannot be created by instantiating an instance of the
    Database class.
    C. Incorrect: An initDatabase() command does not exist in Web SQL.
    D. Correct: The openDatabase() command is used for both new and existing
    databases.

  3. Correct answer: A
    A. Correct: The question mark is used as a placeholder for SQL arguments being
    passed in.
    B. Incorrect: No syntax is available for accessing arguments by a zero-based index.
    C. Incorrect: No syntax is available for accessing arguments by a one-based index.
    D. Incorrect: This form of placeholder is commonly used for string.Format() method
    calls in C# but is not valid for Web SQL.


Lesson 2



  1. Correct answer: D
    A. Incorrect: Transactions are supported by IndexedDB.
    B. Incorrect: Cursors are supported by IndexedDB.
    C. Incorrect: Indexes are supported by IndexedDB.
    D. Correct: The SQL syntax is not supported by IndexedDB.

Free download pdf