你加了alert("aaaa")之后,起了延时的作用,这时poptest.html已经完全调入。

解决方案 »

  1.   

    你不要用open,用ShowModalDialog试试。
      

  2.   

    try something like
    <script>
    var win;
    function test2()
    {
      if (win.document.readyState == "complete")
      {
    win.document.f1.n1.value="testvalue";
       }
       else
    setTimeout("test2()",200);
    }
     function test(){
      win = window.open("poptest.html","winProdSelect","");
    setTimeout("test2()",200);
    }
    </script>
      

  3.   

    win = window.open("poptest.html?testvalue="+testvalue,"winProdSelect","");在poptest.html中加入
    function toquery()
    {
      var tmpstr=unescape(window.location.toString());
      var tmp=tmpstr.indexOf('?')
      tmpstr=tmpstr.substring(tmp+1,tmpstr.length);
      var strs=tmpstr.split('&');
      for (var i=0;i<strs.length;i++) eval(strs[i]+";");
    }
    toquery();
    document.f1.n1.value=testvalue;如果testvalue是字符串的话:
    win = window.open("poptest.html?testvalue=\""+testvalue+"\"","winProdSelect","");
      

  4.   

    谢谢karma(无为),你的方法可行。我以搞定。
    同时也谢谢大家的热情的帮助。
    问题在于net_lover(孟子E章)说的那样,win还没有生成还没有生成。
    用karma(无为)的win.document.readyState == "complete"检测。
    怎么加分????
      

  5.   

    timer=setInterval('try{win.document.f1.n1.value="testvalue";clearInterval(timer)}catch(e){}',300);