xml在html中的使用
来源:互联网 发布:软件专业毕业设计题目 编辑:程序博客网 时间:2024/06/07 05:30
<HTML><HEAD><TITLE>New Document </TITLE>
<script>
functionck()
{
alert(arrSel);
document.all(arrSel[1]).options[document.all(arrSel[1]).selectedIndex].text;
}
</script>
<BODY>
<formname=form1>
<select name=year></select>
<select name=month></select>
<select name=date></select>
<select name=hour> </select>
<input type=text name=result>
<script>
vararrSel=["year","month","date","hour"];
</script>
<xml id=xmldata>
<xmldata>
<yearvalue="2000">
<month value="1">
<date value="1">
<hour value="1"/>
<hour value="2"/>
</date>
<date value="2">
<hour value="1"/>
<hour value="2"/>
</date>
</month>
<month value="2">
<date value="1">
<hour value="1"/>
<hour value="2"/>
</date>
<date value="2">
<hour value="1"/>
<hour value="2"/>
</date>
</month>
</year>
<year value="2001">
<month value="1">
<date value="1">
<hourvalue="1"/>
<hourvalue="2"/>
</date>
<date value="2">
<hourvalue="1"/>
<hourvalue="2"/>
</date>
</month>
<month value="2">
<date value="1">
<hourvalue="1"/>
<hour value="2"/>
</date>
<date value="2">
<hourvalue="1"/>
<hourvalue="2"/>
</date>
</month>
</year>
<year value="2002">
<month value="1">
<date value="1">
<hour value="1"/>
<hour value="2"/>
</date>
<date value="2">
<hour value="1"/>
<hour value="2"/>
</date>
</month>
<month value="2">
<date value="1">
<hourvalue="1"/>
<hour value="2"/>
</date>
<date value="2">
<hourvalue="1"/>
<hourvalue="2"/>
</date>
</month>
</year>
<year value="2003">
<month value="1">
<date value="1">
<hour value="1"/>
<hour value="2"/>
</date>
<date value="2">
<hour value="1"/>
<hour value="2"/>
</date>
</month>
<month value="2">
<date value="1">
<hourvalue="1"/>
<hourvalue="2"/>
</date>
<date value="2">
<hourvalue="1"/>
<hourvalue="2"/>
</date>
</month>
</year>
</xmldata>
</xml>
<script>
functionlpxml(num)
{
vari,j,arrTemp=[];
for(i=0;i<num;i++) {arrTemp[i]=document.all(arrSel[i]).options[document.all(arrSel[i]).selectedIndex].text;
//alert(arrTemp[i]);
}
if(num==arrSel.length)
{
document.all("result").value=arrTemp;return;
}
with(document.all(arrSel[num]))
{ length=0
varobj=document.all.xmldata.XMLDocument.childNodes[0];
for(i=0;i<num;i++)
obj=obj.selectSingleNode(arrSel[i]+'[@value="'+arrTemp[i]+'"]');
for(i=0;i<obj.childNodes.length;i++)options[length++].text=obj.childNodes[i].getAttribute("value");
onchange=newFunction("lpxml("+(num+1)+")");
onchange();
}
}
lpxml(0);
</script>
<input type=buttononclick="ck()">
</form>
</BODY>
</HTML>
- xml在html中的使用
- JavaScript 在HTML中的使用
- JavaScript在HTML中的使用
- XML在Qt中的使用
- 在XML中使用HTML JavaScript标记
- 在html,js,xml中使用Ajax
- XML数据在Javascript,HTML中使用
- xml与xml在python中的使用
- AvtiveX控件在html中的使用问题
- CHtmlCtrl在VC中的使用HTML
- JavaScript变量以及在HTML中的使用
- 深夜课堂:JavaScript在HTML中的使用
- Bootstrap在jsp及html中的使用
- 在markdown中使用HTML中的特殊符号:
- js+html在android中的使用
- 通配符在struts.xml中的使用
- android之 clipdraw 在 .xml中的使用
- Android中Shape 在xml中的使用
- 在eclipse中使用junit测试
- 此数据库没有有效所有者,因此无法安装数据库关系图支持对象,解决方案
- c++预定义
- TreeSet类 Comparator与Comparable
- input 的样式
- xml在html中的使用
- 数据结构实验 栈和队列
- mysql DISABLE/ENABLE KEYS
- Linux下开发warning:"the `gets' function is dangerous and should not be used"
- android面试(三)
- Hdu1084 What Is Your Grade?
- android面试(四)
- coreseek(中文全文搜索)安装和使用(一)
- innerText, innerHTML,outerHTML