我觉得就是document.frames('iframe1').document.all['xml1'].src="filexml1.asp?treeid="+document.form1.parentNumber.value;还没有加载完成的时候,让后又没有alert停顿,这里XMLData.XML=document.frames('iframe1').document.all['xml1'];就开始读取数据,所以没有取道数据信息,我不知道我分析的对不对,但是怎样解决呢?

解决方案 »

  1.   

    又没有一个程序可以让javascript的延时一会的?
      

  2.   

    setTimeout("程序",time) 
    setInterval("程序",time)
      

  3.   

    郁闷..我都这样试了,还是不行:
    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";
      

  4.   

    GetXMLData是我自己写的,错误就是xml的节点找不到。
      

  5.   

    用类似这样的:document.frames('frame1').onload = function {
      XMLData.XML=document.frames('iframe1').document.all['xml1'];
    }
      

  6.   

    readyState Property  Internet Development Index --------------------------------------------------------------------------------Retrieves the current state of the object. SyntaxHTML N/A 
    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. 
      

  7.   

    确实是因为frame没有加载好,所以取不到数据
    可以把后面的代码写在iframe对象的onload事件里面
      

  8.   

    怎样判断iframe的加载状态呢?
      

  9.   

    因为我的这些代码是一个按钮触发的.所以不好直接写道onload事件里面阿.再现等!!
      

  10.   

    问题解决了!这样就可以了:
    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);
    }
    }
      

  11.   

    这是脚本的延时,因为一方面调用服务器的程序运行,一方面调用客户端javascritp,所以一定有这样的问题,我在编写时也常遇到。。可惜来晚了。