如题:
解决方案 »
- js中 超链接的写法,拼接字符串
- 给定日期字符串,如何得出星期几?
- html+js 如 何 实 现 这 样 一 个 简 单 功 能
- 求助:一段代码可以在IE中运行,但在Firefox里必须去掉DTD标识才行?
- 【100分 请教】 一个客户端加密的东西
- js如何响应acitvex的事件?
- 有谁知道这个网站用什么框架做的,思路是什么
- 一篇文章太长,能否隐藏部分内容,然后点击"显示全部内容",才显示所有内容,请问这个怎么处理啊
- 编写一个按钮,点击后相当于在键盘上按 Ctrl+F (就是查询) 的效果,或者进入页面进接弹出 查询框(Ctrl+F查询框)
- 用这个方法能够给form里面的select 和 text负值吗!document.formname.textname.value=变量!还有select一定要给我说说啊
- 这两种函数定义方法有什么不同?
- 求一正则 验证日期格式 DD/MM/YYYY
中我的回复
把xmlReportData.async = "false"; 改成xmlReportData.async = "true";就是异步
中我的回复..
<script language="javascript">
var xmlDoc;
function initialize()
{
if(window.ActiveXObject)
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.onreadystatechange=function()
{
if(xmlDoc.readyState==4)
{
handleXmlDoc();
}
}
xmlDoc.load("data.xml");
}
else if(document.implementation&&document.implementation.createDocument)
{
xmlDoc=document.implementation.createDocument('','',null);
xmlDoc.onload=handleXmlDoc;
xmlDoc.load("data.xml");
}
}
function handleXmlDoc()
{
var root=xmlDoc.documentElement;
var info=root.getElementsByTagName("info")[0];
alert(info.getAttribute("type"));
for(var i=0; i<info.childNodes.length; i++)
{
alert(info.childNodes[i].firstChild.nodeValue);
}
}
window.onload=initialize;
</script>xml文件:
<?xml version="1.0" encoding="GB2312"?>
<root>
<info type="student">
<name>Hello</name>
<sex>Female</sex>
</info>
</root>
<configuration>
<appSettings>
<add key="123" value="456"/>
</appSettings>
</configuration>我要在页面中异步获取<add>节点中key属性和value属性的值!也就是得到123和456