Javascript技术技巧大全(五)

2019-06-03 09:29:44于丽

 rs.moveNext; 
  } 
  shtml += "</table>"; 
  document.write(shtml); 
  rs.close();  
  rs = null;  
  conn.close();  
  conn = null; 
</script> 
//使用数据岛 


<html> 
<body> 
srno:<input type=text datasrc=#xmldate DataFLD=srno size="76"><BR> 
times:<input type=text datasrc=#xmldate DataFLD=times size="76"><BR> 
<input id="first" TYPE=button value="<< 第一条记录" onclick="xmldate.recordset.moveFirst()"> 
<input id="prev" TYPE=button value="<上一条记录" onclick="xmldate.recordset.movePrevious()">   
<input id="next" TYPE=button value="下一条记录>" onclick="xmldate.recordset.moveNext()">   
<input id="last" TYPE=button value="最后一条记录>>" onclick="xmldate.recordset.moveLast()">    
<input id="Add" TYPE=button value="添加新记录" onclick="xmldate.recordset.addNew()">   

<XML ID="xmldate"> 
<infolist> 
<info ><srno>20041025-01</srno><times>null</times></info> 
<info ><srno>20041101-09</srno><times>2004年10月1日2点22分0秒</times></info> 
</infolist> 
</XML> 
</body> 
</html> 
//获得参数 

<body> 
<a href="javascript:location.href=location.href + '?a=1&b=2'">search</a> 
<script language="JavaScript"> 
<!-- 
var a = location.search.substr(1); 
if(a.length>0) 

 var re = /([^&]*?)=([^&]*)/g 
 var s = a.match(re); 
 for(var i= 0;i<s.length;i++) 
 { 
  alert(s[i]); 
  alert(s[i].split("=")[1]); 
 } 

//--> 
</script> 
</body> 
//可编辑SELECT 

<input type=text name=re_name style="width:100px;height:21px;font-size:10pt;"><span style="width:18px;border:0px solid red;"><select name="r00" style="margin-left:-100px;width:118px; background-color:#FFEEEE;" onChange="document.all.re_name.value=this.value;"> 
                <option value="1">11111111<option> 
                <option value="2">222222</option>