DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> JavaScript入門知識 >> 關於JavaScript >> JSQL 批量圖片切換的實現代碼
JSQL 批量圖片切換的實現代碼
編輯:關於JavaScript     
復制代碼 代碼如下:
<!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 下載地址
XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved