0
嗨,我在移動應用程序,我有以下問題。功能循環內的jquery函數
我想從表billbayments中的每個條形碼的表法案中選擇數據。
這裏是我的代碼
t.executeSql('SELECT barcode, amount, receiptno FROM billpayments WHERE receiptno > 0',
[], function(t, resultcollect) {
len = resultcollect.rows.length;
for (i = 0; i < len; i += 1) {
row = resultcollect.rows.item(i);
t.executeSql('SELECT barcode, buildingcode, flatdescription FROM bill WHERE barcode = ?',
[row.barcode], function(t, collectaddress) {
mybill = collectaddress.rows.item(0);
list.append('' + mybill.buildingcode + ',' + mybill.flatdescription + ',' + row.receiptno + ',' + row.amount + '</br>');
});
}
tameio = tameio.toFixed(2);
list.append('<table border="1">' + items.join('\n') + itemspay.join('\n') + '</table><p>' + tameio + '');
});
但在HTML追加我收到row.receiptno和row.amount所有條形碼的最後一個值...
請幫助我被困。
這是我的錯。 thx爲你的時間 – kosbou 2012-03-14 17:00:39
@ user1081978這是一個常見的錯誤。我希望你已經學會不再這樣做;) – 2012-03-14 17:01:09