onload后就不应该用document.write,因为输出流已经关闭了!
用element.innerHTML=returnStr;

解决方案 »

  1.   

    因为后台返回的returnStr是整个页面的html代码,所以使用了document.write(returnStr);
    下面是代码。如果有什么方法可以执行body onload函数以及页面开始包括的js文件就ok了。
    至于为什么用局部刷新机制进行整个页面的刷新,也是因为客户变态的需求不得而为之。这方面不做讨论。function submitRPC(actionstr){
    var actionStr = actionstr;
    Initialize();
    if(req!=null){
    req.onreadystatechange = ProcessSubmit;
    req.open("post",actionStr,false);
    req.send(null);
    }
    if(returnStr.substr(0,3)=='MSG'){
    alert(returnStr.substr(3));
    }else{
    document.open();
    document.write(returnStr);
    alert(returnStr);
    document.close();
    resize();
    resize();
    }

    }
      

  2.   

    页面都重写了,肯定需要重新引入script块,试试写在iframe中
      

  3.   

    你把初始化的东西封装到函数里面,onload和局部刷新的时候调用相同的函数不就得了。