js 变量作用域问题,参数无法顺利传入给子函数 试试看..makeRequest(url, function(){functionName(classid,id,pagenum)}, "GET", ''); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 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", ''); 是不是这样啊?? 谁有爬虫工具的源代码 如何用javascript实现"explorer.exe ftp://10.10.100.6"的效果 关于QQ博客中的背景图片问题 新手的一个问题急求大家帮忙,重分请教啊~在线等! 字符串比较问题! 麻烦 大虾们 帮我看下这个效果为什么会这样 正则表达式在ie6 可以,ie5出错 有这样一个函数吗? ------使后面的HTML停止加载~ 怎样用javascript设置table1的第一列(总是存在的)宽度为一个指定的值! CSDN皮肤切换机构原理验证测试,请大家来测试。 script的src属性 如何获取行或列的ID
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", '');
是不是这样啊??