I'm trying to use $.each to speed up iteration of a SqlResultsetRowList where I'm currently using a For loop. Here is the new code -
localDB.transaction(function(transaction){ transaction.executeSql(query, [val], function(transaction, results) { var rows = results.rows; $.each(rows, function(i) { var row = results.rows.item(i); }); } ) });
The problem is i is being returned as not the index but the string "length" and it obviously breaks at that point.
I've done some further testing and this works as expected in Chrome. Chrome sees the SqlResultsetRowList as an array but Safari doesn't. Is it possible to maybe convert the result set to an array so Safari can iterate it using $.each?
Aucun commentaire:
Enregistrer un commentaire