如下代码,在执行过程中运行到最后一句xmlhttp.Send(null);的时候要老半天才反应过来,前台页面就和死机一样 但得到的结果又没错误,只是响应慢,其他页面调用类似方法就能直接响应
var xmlhttp = new ActiveXObject("Msxml2.XMLHttp");
  xmlhttp.Open("GET", "myserver/orders/processorder.asp", true);   
  xmlhttp.onreadystatechange= HandleStateChange;   
  xmlhttp.Send(null);请熟悉ActiveX的朋友给我解解惑

解决方案 »

  1.   

    你这个可能还有页面缓存的问题
    xmlhttp.Open("GET", "myserver/orders/processorder.asp?ajax=refresh&"+Math.random(), true);  
    加个参数,每次访问链接都不一样,试一下
      

  2.   


    public ActionForward execute(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response) throws WHDCRMException {

    String id=request.getParameter("id");
    if(id==null){
    return mapping.findForward("list");
    }
    response.setContentType("text/xml;charset=UTF-8");
    response.setCharacterEncoding("UTF-8");
    PrintWriter out;
    try {
    out = response.getWriter();
    String returnstr="";
    returnstr=this.getTree(id);
    out.println(returnstr);
    out.flush();
    out.close();
    } catch (IOException e) {
    e.printStackTrace();
    }
    return null;
    }
      

  3.   

    public ActionForward execute(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response) throws WHDCRMException {

    String id=request.getParameter("id");
    if(id==null){
    return mapping.findForward("list");
    }
    response.setContentType("text/xml;charset=UTF-8");
    response.setCharacterEncoding("UTF-8");
    PrintWriter out;
    try {
    out = response.getWriter();
    String returnstr="";
    returnstr=this.getTree(id);
    out.println(returnstr);
    out.flush();
    out.close();
    } catch (IOException e) {
    e.printStackTrace();
    }
    return null;
    }
      

  4.   

    function writeTree(xmlDom){
        functions=xmlDom.getElementsByTagName("Dic");
        var returnstr="";
        for(i=0;i<functions.length;i++){
            returnstr+="<div>";
            
            var level=new Number(functions[i].getAttribute("level"));
            for(n=0;n<level;n++){
                returnstr+="&nbsp;&nbsp;&nbsp;&nbsp;";
            }
            if(functions[i].getAttribute("hasNext").toLowerCase()=="true"){
                returnstr+="&nbsp;&nbsp;<img id=node"+functions[i].getAttribute("id")+" src='../images/icon_tree_+.gif' onclick=getChildTree('"+functions[i].getAttribute("id")+"','post'); style='cursor:hand;' status='+'>&nbsp;";
            }else{
                returnstr+="&nbsp;&nbsp;<img id=node"+functions[i].getAttribute("id")+" src='../images/em.gif' style='cursor:hand;' status='+'>&nbsp;";
            }
            
            returnstr+="<img src='../images/tree_07.gif' >";
            returnstr+="<span oncontextmenu=\"showRightMenu('"+functions[i].getAttribute("id")+"');fresh();\" style=\"cursor:hand;\"><a style=\"color:black;\" href=\"displayWorkEvaluation.do?id="+functions[i].getAttribute("id")+"\">"+functions[i].getAttribute("title")+"</a></span>";
            returnstr+="</div><div id=subnode"+functions[i].getAttribute("id")+" style='DISPLAY:none' loaded='no'></div>";
            
            var rms=functions[i].getElementsByTagName("RightMenu");
            for(n=0;n<rms.length;n++){
                var rm=new Array();
                rm.push(functions[i].getAttribute("id"));
                rm.push(rms[n].getAttribute("title"));
                rm.push(rms[n].getAttribute("url"));
                RightMenus.push(rm);
            }
        }
        
        subnode.innerHTML=returnstr;
    }