S
S
Sergey2016-04-22 14:27:48
phonegap
Sergey, 2016-04-22 14:27:48

Why is Web SQL not generated?

Good afternoon.
There is the following code

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="msapplication-tap-highlight" content="no" />
    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />
</head>

<body>

    <script type="text/javascript" charset="utf-8">
        var db = openDatabase("ToDo", "0.1", "A list of to do items.", 200000);
        if(!db){alert("Failed to connect to database.");}

        db.transaction(function(tx) {
            tx.executeSql("INSERT INTO ToDo (label, timestamp) values(?, ?)", ["Купить iPad или HP Slate", new Date().getTime()], null, null);
        });

        db.transaction(function(tx) {
            tx.executeSql("SELECT * FROM ToDo", [], function(tx, result) {
                for(var i = 0; i < result.rows.length; i++) {
                    $('#thelist').append('<b>' + result.rows.item(i)['label'] + '</b><br />');
                }}, null)});
    </script>

    <div id="thelist"></div>

    <script type="text/javascript" src="cordova.js"></script>

</body>

</html>

Why is nothing being retrieved from the database?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question