Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

5. Client-Side Data Storage > Client-Side Database

Client-Side Database

Of all the exciting features of HTML5, the one that rocks my world the most is client-side database support. It allows developers to use a simple but powerful JavaScript database API to store persistent data in a relational format.

Developers can use standard SQL statements to create tables; to insert, update, select, and delete rows; and so on. The JavaScript database API even supports transactions. We’re talking about SQL here, so there is an inherent complexity. Regardless, this is a game-changing feature, so time spent getting your head around it will be well rewarded.

Creating a Database

Now that our Date panel knows what date the user has selected, we have all the info we need to allow users to create entries. Before we can write the createEntry function, we need to set up a database table to store the submitted data. I’ll add some lines to kilo.js to do so:


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint