javascript使用xml 数据岛 简单实例

it2025-03-20  15

<script language='javascript'>      function test()      {             alert('xml');

      var rs, option1;       rs = xmlCustomer.recordset;      alert(rs);             alert(xmlCustomer.recordset.recordcount);      for (var i=0; i < xmlCustomer.recordset.recordcount; i++)          {       //option1 = document.createElement("OPTION");       //option1.text = rs("CustomerCode");       //option1.value = rs("CustomerName");       //alert(option1.text);       //alert(option1.value);                   document.all["ddlCustomer"].options[i] = new Option(rs("CustomerCode"),rs("CustomerName"));                   //ddlCustomer.add(option1);       rs.movenext;       }                         }      </script>      <XML id="xmlCustomer" >

     <ROOT>       <Customer>       <CustomerCode>ABC Corp.</CustomerCode>       <CustomerName>1</CustomerName>       </Customer>       <Customer>       <CustomerCode>BBC Tech.</CustomerCode>       <CustomerName>2</CustomerName>       </Customer>      </ROOT>      </XML>              <select ID="ddlCustomer" name="ddlCustomer" runat="server"></select><input type=button value='ok' οnclick='test()'>

转载于:https://www.cnblogs.com/HappyQQ/articles/1026494.html

相关资源:数据结构—成绩单生成器
最新回复(0)