JSFiddle - React, Tailwind, and code Playground

by remguif

HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<!DOCTYPE html5>
<html>
<!-- copyright (c) 2010 Google inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Author: Paul Kinlan
 -->
  <head>
    <title>Simple Sample using HTML5 Web database.</title>
    <script>
    
    var html5rocks = {};
    html5rocks.webdb = {};
    html5rocks.webdb.db = null;
        
    html5rocks.webdb.open = function() {
    	console.log({cmd:"html5rocks.webdb.open"});
      var dbSize = 5 * 1024 * 1024; // 5MB
      html5rocks.webdb.db = openDatabase("Todo", "1", "Todo manager", dbSize);
    }
    
    html5rocks.webdb.createTable = function() {
    	console.log({cmd:"html5rocks.webdb.createTable"});
      var db = html5rocks.webdb.db;
      db.transaction(function(tx) {
        tx.executeSql("CREATE TABLE IF NOT EXISTS todo(ID INTEGER PRIMARY KEY ASC, todo VARCHAR(500), added_on DATETIME, priority double, sub varchar(250))", []);
        tx.executeSql("CREATE TABLE IF NOT EXISTS TIME_TRACKER(ID INTEGER PRIMARY KEY ASC, id_todo int,dtStart DATETIME, dtEnd DATETIME)", []);
      });
    }
    
    html5rocks.webdb.dropTable = function() {
    	console.log({cmd:"html5rocks.webdb.dropTable"});
      var db = html5rocks.webdb.db;
      db.transaction(function(tx) {
        tx.executeSql("DROP TABLE todo", []);
        tx.executeSql("DROP TABLE time_tracker", []);
      });
    }
    //html5rocks.webdb.dropTable();

   ...

JavaScript

if (navigator.onLine) console.log("I'm online");
else console.log("I'm offline");