javascript使用xml 数据岛 简单实例
2012-03-09 00:00
621 查看
javascript使用xml 数据岛 简单实例
<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' onclick='test()'>
$(document).ready(function(){dp.SyntaxHighlighter.HighlightAll('code');});
原文链接:
http://blog.csdn.net/newhappy2008/article/details/2255365
<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' onclick='test()'>
$(document).ready(function(){dp.SyntaxHighlighter.HighlightAll('code');});
原文链接:
http://blog.csdn.net/newhappy2008/article/details/2255365
相关文章推荐
- javascript使用xml 数据岛 简单实例
- javascript使用xml 数据岛 简单实例
- javascript使用xml 数据岛 简单实例
- javascript使用xml 数据岛 简单实例
- javascript使用xml 数据岛 简单实例
- 使用javascript访问XML数据的实例
- 使用javascript访问XML数据的实例
- FusionCharts简单教程(二)-----使用js加载图像和setDataXML()加载数据
- 使用JavaScript访问XML数据
- javascript中checkbox使用方法简单实例演示
- android使用Jsoup进行html数据解析简单实例浅析
- 使用JavaScript访问XML数据
- javascript数据类型和函数的简单的使用
- 解析XML,将数据显示在treeview上,使用简单工厂模式
- ASP.NET AJAX中 复杂数据类型使用简单实例
- java30.XML操作------使用Dom4j简单操作XML数据举例
- 【实例下载】javascript代码在html显示xml数据上一条记录和下一条记录
- jQuery使用ajax跨域获取数据的简单实例
- JQuery解析XML数据的几个简单实例
- 一个简单的使用XMLHttpRequest获得服务器数据的例子