操作Object Array
其实还可以这样操作:
var Room = [
{
ID: 'bot',
name: 'test',
sex: true
}, {
ID: 2,
name: 'test8',
sex: true
}, {
ID: 3,
name: 'test5',
sex: false
}, {
ID: 4,
name: 'test2',
sex: true
}];
"update Room set name = 'man' where sex=true".executeSQL();
支持的SQL语句有 SELECT \ INSERT \ UPDATE \ DELETE \ CREATE TABLE \ DROP TABLE
3.上回说道我发现DOM其实也可以用SQL操作
比方说,你可以直接插入100个图片element操作如下:
JScript code
'create table logolist'.ForDOM().executeSQL();for(vari=0;i<100;i++) {"insert into logolist(nodename,title,src) values ('img','google','images/google.gif')".ForDOM().execute();
};
然后用UPDATE更新图片元素的src属性:
JScript code
("update logolist set src='"+logo1+"'").ForDOM().execute();
或者是DELETE这些符合条件的元素:
JScript code
("delete from logolist where title='google'").ForDOM().execute();
亦或是充当selector:
JScript code
varresult=("select * from logolist").ForDOM().execute();for(vari=0;i<result.length;i++) {
result[i].src='baidu.gif';
};