我觉得就是document.frames('iframe1').document.all['xml1'].src="filexml1.asp?treeid="+document.form1.parentNumber.value;还没有加载完成的时候,让后又没有alert停顿,这里XMLData.XML=document.frames('iframe1').document.all['xml1'];就开始读取数据,所以没有取道数据信息,我不知道我分析的对不对,但是怎样解决呢?
调试欢乐多
setInterval("程序",time)
document.frames('iframe1').document.all['xml1'].src="filexml1.asp?treeid="+document.form1.parentNumber.value;
var i=1
while(i>100000000000000000000)
{i=i+1;}
var XMLData=new GetXMLData();
XMLData.XML=document.frames('iframe1').document.all['xml1'];
XMLData.findNodeName="No";
XMLData.findNodeValue=1;
XMLData.findNodeType="num";
strResult1=XMLData.getData("parent");
document.form1.parentNumber.value=strResult1;
document.form1.okok.value="nono";
XMLData.XML=document.frames('iframe1').document.all['xml1'];
}
Scripting [ vState = ] object.readyState Possible ValuesvState Variant that receives one of the following values.uninitialized Object is not initialized with data.
loading Object is loading its data.
loaded Object has finished loading its data.
interactive User can interact with the object even though it is not fully loaded.
complete Object is completely initialized.
The property is read-only. The property has no default value.ResThe states through which an object passes are determined by that object; an object can skip certain states (for example, interactive) if those states do not apply to that object.Standards InformationThere is no public standard that applies to this property.
可以把后面的代码写在iframe对象的onload事件里面
function loadxml()
{
if(iframe1.document.all['xml1'].readyState=="complete")
{
//alert('complete');
var XMLData=new GetXMLData();
XMLData.XML=document.frames('iframe1').document.all['xml1'];
XMLData.findNodeName="No";
XMLData.findNodeValue=1;
XMLData.findNodeType="num";
strResult1=XMLData.getData("parent");
document.form1.parentNumber.value=strResult1;
document.form1.okok.value="nono";
}
else
{
setTimeout("loadxml()",500);
}
}