var http_request1 = false; function zixunMakeRequest(url, functionName, httpType, sendData) { http_request1 = false; if (!httpType) httpType = "GET"; if (window.XMLHttpRequest) { // Non-IE... http_request1 = new XMLHttpRequest(); if (http_request1.overrideMimeType) { http_request1.overrideMimeType('text/plain'); } } else if (window.ActiveXObject) { // IE try { http_request1 = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request1 = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!http_request1) { alert('Cannot send an XMLHTTP request'); return false; } var changefunc="http_request1.onreadystatechange = "+functionName; eval (changefunc); //http_request1.onreadystatechange = alertContents; http_request1.open(httpType, url, true); http_request1.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); http_request1.send(sendData); } //评论分页提交 function zixunToPage(page,p){ zixunMakeRequest('/e/ecmsshop/zixun/zixun.php?classid=104&id=47&page='+page+'&t='+Math.random()+'&p='+p,'zixunReturnedText','GET',''); } //区分评价 function zixunTopj(a,pj){ zixunMakeRequest('/e/ecmsshop/zixun/zixun.php?classid=104&id=47&p='+pj+'&t='+Math.random(),'zixunReturnedText','GET',''); } //评论分页显示 function zixunReturnedText() { if(http_request1.readyState == 4) { if(http_request1.status == 200) { var messagereturn = http_request1.responseText; if(messagereturn!='isfail') { var r; r=messagereturn.split(''); if(r.length!=1) { if(r[0]!='') { $(".zixun-total-sf").text(r[0]); //咨询数量 } $("#showzxfl").html(r[1]); document.getElementById('zixun-lists-sf').innerHTML=r[2]; //输出咨询内容 } else { //document.getElementById('comment-lists-sf').innerHTML=messagereturn; } } } else { alert('There was a problem with the request.'); } } } //首页 zixunToPage(0,"");