JSQL 批量图片切换的实现代码

时间:2021-05-26

复制代码 代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="../src/YESBRAIN.js"></script>
<script type="text/javascript" src="../src/JSQL.js"></script>
<script type="text/javascript" src="../src/JSQL-DOM.js"></script>
<title>Switch Logo Images</title>
</head>
<body>
<button onClick="switchlogos();"> 切换 LOGOS </button>

<script type="text/javascript">
title1 = "google";
title2 = "baidu";
logo1 = "images/google.gif";
logo2 = "images/baidu.gif";
function switchlogos() {
//alert('switch');
var tmplogo = logo1;
var tmptitle = title1;
logo1 = logo2;
title1 = title2;
logo2 = tmplogo;
title2 = tmptitle;
("update logolist set src='" + logo1 + "', title='" + title1 + "'").ForDOM().execute();
};
'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();
};
//("delete from logolist where (1=1)").ForDOM().execute();

</script>
</body>
</html>

其中,还用到了JSQL的DOM元素插入操作:
复制代码 代码如下:
'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();
};

欢迎各位拍砖!
jsql javascript 下载地址

声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。

相关文章