如何将此索引数组添加names
到localStorage
. 并调用这个元素:
var name= new Array();
for( var i=0; i<results.rows.length; i++ ) {
names[results.rows.item(i).IdTypePrestation ] = results.rows.item(i).LibellePrestation;
}
如果我改变这一行:
names[results.rows.item(i).IdTypePrestation] = results.rows.item(i).LibellePrestation;
对此:
names[i] = results.rows.item(i).LibellePrestation;
一切都好,但我需要第一行。