下载首页下载分类最近更新排 行 榜国产软件国外软件汉化补丁本站论坛BT下载页
  • 设为首页
  • 收藏本站
  • 联系我们
您的位置:首页网页制作JS/Ajax → 推荐:最新 javascript 技巧集
推荐:最新 javascript 技巧集
出处:本站整理 作者:佚名 日期:2007-5-7 16:47:30 人气: [ ]

 //使用数据岛

  
  <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>
                  <option value="3">333333</option>
                </select>
                </span>

   

  //设置光标位置

  
  function getCaret(textbox)
  {
   var control = document.activeElement;
   textbox.focus();
   var rang = document.selection.createRange();
    rang.setEndPoint("StartToStart",textbox.createTextRange())
   control.focus();
   return rang.text.length;
  }
  function setCaret(textbox,pos)
  {
   try
   {
    var r =textbox.createTextRange();
     r.moveStart('character',pos);
     r.collapse(true);
     r.select();
   }
   catch(e)
   {}
  }
  function selectLength(textbox,start,len)
  {
   try
   {
    var r =textbox.createTextRange();
   
    r.moveEnd('character',len-(textbox.value.length-start));
    r.moveStart('character',start);
    
    r.select();
   }
   catch(e)
   {//alert(e.description)}
  }
  function insertAtCaret(textbox,text)
  {
   textbox.focus();
   document.selection.createRange().text = text;
  }

相关文章
相关软件
评论人 评论内容摘要(共 0 条,查看完整内容) 得分 0 发表时间
关于本站 | 广告服务 | 版权声明 | 联系我们 | | 联系我 | 交流群:1361692 7710545
本站部分带宽由:华夏名网武汉IDC数据中心 赞助[排名不分先后] Powered By 零度软件园
本站软件均来源于网络,仅供学习所用。若侵犯了你的权益,请立即通知我们,我们将第一时间删除!