You can actually do this:
Copy Code code as follows:
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 ();
Supported SQL statements have SELECT \ INSERT \ UPDATE \ DELETE \ CREATE TABLE \ DROP TABLE
3. Last time I found out that DOM can actually be manipulated with SQL
For example, you can insert 100 images directly into the element operation as follows:
Copy Code code as follows:
' CREATE Table Logolist '. Fordom (). ExecuteSQL ();
for (Var i=0;i<100;i++) {
"INSERT into Logolist (NODENAME,TITLE,SRC) VALUES (' img ', ' Google ', ' images/google.gif ')". Fordom (). Execute ();
};
Then update the SRC attribute of the picture element with update:
Copy Code code as follows:
("Update logolist set src= '" + Logo1 + ""). Fordom (). Execute ();
or delete these qualified elements:
Copy Code code as follows:
("Delete from logolist where title= ' Google '"). Fordom (). Execute ();
or act as a selector:
Copy Code code as follows:
var result = ("select * from Logolist"). Fordom (). Execute ();
for (Var i=0;i<result.length;i++) {
Result[i].src = ' baidu.gif ';
};