1 <!DOCTYPE HTML> 2 <html> 3 <title>Select read-transactions (store results in JS variables)</title> 4 <script src="../head.js"></script> 5 <script src="../common.js"></script> 6 <script> 7 var idCounter = 0; 8 var resultId = 0; 9 var resultString = ''; 10 11 function transactionCallback(tx) { 12 tx.executeSql('SELECT * FROM Test WHERE ID = ?', [idCounter++], 13 function(tx, data) { 14 for (var i = 0; i < data.rows.length; i++) { 15 resultId = data.rows.item(i).ID; 16 resultString = data.rows.item(i).Foo; 17 } 18 }, function(tx, error) {}); 19 } 20 </script> 21 22 <body> 23 <script> 24 runPerformanceTest({ 25 dbName: "SelectReadTransactionsReadResults", 26 readOnly: true, 27 insertRowsAtSetup: true, 28 transactionCallback: transactionCallback, 29 customRunTransactions: null 30 }); 31 </script> 32 </body> 33 </html> 34