summaryrefslogtreecommitdiffstats
path: root/tools/page_cycler/database/select-readtransactions-read-results/index.html
blob: 40a2d87008eed96e06f24dea5d6d751c378a2436 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE HTML>
<html>
<title>Select read-transactions (store results in JS variables)</title>
<script src="../head.js"></script>
<script src="../common.js"></script>
<script>
var idCounter = 0;
var resultId = 0;
var resultString = '';

function transactionCallback(tx) {
  tx.executeSql('SELECT * FROM Test WHERE ID = ?', [idCounter++],
                function(tx, data) {
                  for (var i = 0; i < data.rows.length; i++) {
                    resultId = data.rows.item(i).ID;
                    resultString = data.rows.item(i).Foo;
                  }
                }, function(tx, error) {});
}
</script>

<body>
<script>
  runPerformanceTest({
    dbName: "SelectReadTransactionsReadResults",
    readOnly: true,
    insertRowsAtSetup: true,
    transactionCallback: transactionCallback,
    customRunTransactions: null
  });
</script>
</body>
</html>