The problem is that your inner function defines a parameter named i
here:
db.transaction(function(t,i){ ...
If you intend for i
to be the value from the outer function, I recommend you simply remove this parameter. It doesn't appear that db.transaction
is actually providing a value for this parameter anyway. You'll probably also want to close the value of i
at each iteration in a separate variable, and use that inside your function, like this:
var index = i;
db.transaction(function(t){ ...
var Noma = window['Produit_en_caisse_' + index ];
alert(index);