Advertisement
Javi

HTML : WebSQL

Nov 27th, 2014
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.64 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <title>Document</title>
  6. </head>
  7. <body>
  8.  
  9.    
  10.    <script>
  11.  
  12.        var database;
  13.        
  14.        window.openDatabase(
  15.           'documents', '1.0',
  16.           'Offline document storage', 5*1024*1024, function (db) {
  17.           database = db;
  18.           database.transaction(function(tx) {
  19.               tx.executeSql('CREATE TABLE docids (id, name)', function() {
  20.                   tx.executeSql('INSERT INTO docids (100, ' + new Date()+ ')');
  21.               });
  22.           });      
  23.              
  24.        });
  25.        
  26.    
  27.     </script>
  28.    
  29. </body>
  30. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement