<div class="codetitle"> <span><a style="CURSOR: pointer" data="66119" class="copybut" id="copybut66119" onclick="doCopy('code66119')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code66119"> <br> <br> <br> <br><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <br><script type="text/javascript" src="../src/YESBRAIN.js"></script> <br><script type="text/javascript" src="../src/JSQL.js"></script> <br><script type="text/javascript" src="../src/JSQL-DOM.js"></script> <br><title>Switch Logo Images</title> <br> <br> <br><button onclick="switchlogos();"> 切换 LOGOS </button> <br><br><script type="text/javascript"> <BR>title1 = "google"; <BR>title2 = "baidu"; <BR>logo1 = "images/google.gif"; <BR>logo2 = "images/baidu.gif"; <BR>function switchlogos() { <BR>//alert('switch'); <BR>var tmplogo = logo1; <BR>var tmptitle = title1; <BR>logo1 = logo2; <BR>title1 = title2; <BR>logo2 = tmplogo; <BR>title2 = tmptitle; <BR>("update logolist set src='" + logo1 + "', title='" + title1 + "'").ForDOM().execute(); <BR>}; <BR>'create table logolist'.ForDOM().executeSQL(); <BR>for(var i=0;i<100;i++) { <BR>"insert into logolist(nodename,title,src) values ('img','google','images/google.gif')".ForDOM().execute(); <BR>}; <BR>//("delete from logolist where (1=1)").ForDOM().execute(); <br><br></script> <br> <br> <br> </div> <br>其中,还用到了JSQL的DOM元素插入操作: <br><div class="codetitle"> <span><a style="CURSOR: pointer" data="57833" class="copybut" id="copybut57833" onclick="doCopy('code57833')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code57833"> <br>'create table logolist'.ForDOM().executeSQL(); <br>for(var i=0;i"insert into logolist(nodename,title,src) values ('img','google','images/google.gif')".ForDOM().execute(); <br>};<br> </div> <br>欢迎各位拍砖! <br><a href="http://www.jb51.net/jiaoben/26138.html" target="_blank">jsql javascript</a> 下载地址