javascript - Phonegap WebSQL DELETE row not work on iPad -
i have 2 functions:
function removepreorder(id) { db.transaction(function(tx) { tx.executesql("delete preorder id= ?", [id], removerow(id)); console.log ('ok'); }); } function removerow(id) { $( "#"+id+"" ).remove(); }
function removepreorder()
binded on click event on href
.
function renderresults(tx, results) { var len = results.rows.length;
var preorder = []; (var i=0; i<len; i++){ preorder.push( "<tr id ='"+results.rows.item(i).id+"'><td>"+results.rows.item(i).name+"</td><td>"+results.rows.item(i).tel+"</td><td>"+results.rows.item(i).email+"</td><td>"+results.rows.item(i).size+"</td><td><a href='#'onclick='removepreorder("+results.rows.item(i).id+")' class='button [tiny small success alert]'>remove</a></td></tr>" ); }
on mac in chrome functions work correctly.
removepreorder()
delete row websql table , removerow()
remove dom object page.
on ipad function removepreorder()
not delete row websql table, removerow()
removes dom object page.
what problem?
problem in
tx.executesql('create table if not exists preorder (id integer auto_increment, name text, tel text, email text, art text, size text, primary key (id))');
this right
tx.executesql('create table if not exists "preorder" ("id" integer primary key autoincrement not null unique , "name" text , "tel" text, "email" text, "art" text, "size" text);');
autoincrement field on ipad return undefined
Comments
Post a Comment