Training Guide: Programming in HTML5 with JavaScript and CSS3 Ebook

(Nora) #1

Lesson 2: Handling storage events CHAPTER 15 565



  1. Which of the following URLs can access data stored on http://www.example.com
    /lesson1/page1.html?
    A. http://www2.example.com/lesson1/page1.html
    B. http://www.example.com:8081/lesson1/page1.html
    C. https://www.example.com/lesson1/page1.html
    D. http://www.example.com/lesson2/page1.html
    E. http://example.com/lesson1/page1.html

  2. What is the web storage limit currently recommended by the World Wide Web
    Consortium (W3C)?
    A. 4 KB
    B. 5 MB
    C. 500 MB
    D. 10 MB

  3. What is the correct syntax for removing all values existing in localStorage?
    A. localStorage.clear();
    B. localStorage.removeAll();
    C. localStorage.abandon();
    D. localStorage.reset();

  4. Which of the following storage mechanisms has the highest level of cross-browser
    support?
    A. Web storage
    B. Web SQL
    C. IndexDB
    D. FileSystem API

  5. Which of the following features does web storage support?
    A. Indexing
    B. Transactions
    C. Asynchronous read/write
    D. Simple key/value pair storage


Lesson 2: Handling storage events


One of the biggest challenges you’ll face when working with web storage is keeping every-
thing in sync when a user has multiple tabs or browser instances open at the same time. For
example, browser tab one might have displayed a value it retrieved from localStorage just
Free download pdf