9. Step 2 The database
Clientside Javascript database
✤
Safari and other webkit based browsers like Google Chrome
✤
An option to sync with a online database
✤
MYSQL commands
✤
User can manage database using preferences
✤
10. Step 2 The database
Example code
var db;
try {
if (window.openDatabase) {
db = openDatabase(quot;Checklistquot;, quot;1.0quot;, quot;HTML5 Database APIquot;, 200000);
if (!db) {
alert(quot;Failed to open the databasequot;);
} else{
var highestId = 0;
}
} else
alert(quot;Couldn't open the database. Please try with a WebKitquot;);
}
11. Step 3 Caching the webapp
Firefox en iPhone safari
✤
HTML 5 manifest file
✤
Example of a manifest file
✤
<html manifest=quot;main.manifestquot;>
CACHE MANIFEST
css/main.css
images/main.png
js/database.js
12. Step 3 Caching the webapp
IMPORTANT !
✤
The manifest file has to have a text/cache-manifest MIME
type
Solution a .htacces
AddType text/cache-manifest .manifest