试试看..makeRequest(url, function(){functionName(classid,id,pagenum)}, "GET", '');

解决方案 »

  1.   


    var xmlHttp = false;
    var classid = 1;
    var id = 2;
    var pagenum = 30;function makeRequest(url, functionName, httpType, sendData) { 
    if (!httpType) httpType = "GET"; 
    if (window.XMLHttpRequest) { // Non-IE... 
    xmlHttp = new XMLHttpRequest(); 
    if (xmlHttp.overrideMimeType) { 
    xmlHttp.overrideMimeType('text/plain'); 

    } else if (window.ActiveXObject) { // IE 
    try { 
    xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); 
    } catch (e) { 
    try { 
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); 
    } catch (e) {} 

    } if (!xmlHttp) { 
    alert('Cannot send an XMLHTTP request'); 
    return false; 
    } xmlHttp.onreadystatechange = functionName; 
    xmlHttp.open(httpType, url, true); 
    xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); 
    xmlHttp.send(sendData); 
    } function getComPage(){     
             if(xmlHttp.readyState==4){ 
                    if(xmlHttp.status==200){ 
                      if(xmlHttp.responseText!=0){ 
                        $(".comnav1").html(xmlHttp.responseText); 
                        getComList(classid,id,pagenum); 
                      }    
                      else { 
                        $(".comnav1").html("");  
                      } 
                    } 
                    else if(xmlHttp.readyState!=4) 
                    { 
                      loadING("#commentinfo");    
                    } 
                } 
        

    var url = '/e/ajax/index.php?'; 
    var params ='action=getComPage' +  '&classid=' + classid + '&id=' + id + '&pagenum=' + pagenum; 
    url+=params; 
    makeRequest(url, getComPage, "GET", '');    
    是不是这样啊??