我正在尝试编写一个查询,该查询从表中提取和转换数据,然后插入到另一个表中。如果我添加字符串,它会起作用,但是当我添加变量时它不会。它给了我空桌子!
function dodb() {
var name = document.getElementsByName('prezime');
var elements = document.getElementsByName('bt');
for (var i = 0; i <= elements.length; i++) {
var oelements = elements[i];
oelements.onclick = (function(){
var name1 = name[i].firstChild.nodeValue;
return function() {
db.transaction(function (tx) {
var a = "INSERT INTO racersA SELECT * FROM racers WHERE prezime=%name1%";
tx.executeSql(a);
});
}
})(i);
}
}