2个AJAX请求返回的信息 被覆盖的问题 将一个ajax请求放到另一个ajax请求的回掉函数中,也就是让他们顺序执行试试. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <script>window.onload=getComList( <?=$classid?>, <?=$id?>,1);</script> ---------------------------------这是两个函数function getComPage(classid,id,pagenum){var url = '/e/ajax/index.php?';var params ='action=getComPage' + '&classid=' + classid + '&id=' + id + '&pagenum=' + pagenum;url+=params;var functionName=function (){ if(xmlHttp.readyState==4){if(xmlHttp.status==200){ if(xmlHttp.responseText!=0){alert(xmlHttp.responseText); $(".comnav1").html(xmlHttp.responseText); } else {$(".comnav1").html(""); }}}};makeRequest(url, functionName, "GET", '');}function getComList(classid,id,pagenum){var url = '/e/ajax/index.php?';var params ='action=getComList' + '&classid=' + classid + '&id=' + id + '&pagenum=' + pagenum;url+=params;var functionName=function (){ if(xmlHttp.readyState==4){if(xmlHttp.status==200){ if(xmlHttp.responseText!=0){ $("#commentinfo").html(xmlHttp.responseText); } else { $("#commentinfo").html(""); }}}};makeRequest(url, functionName, "GET", '');getComPage( <?=$classid?>, <?=$id?>,1);//调用} 试一下 看看 onload你试头调用两次你这写法不对的onload=function(){ getComList( <?=$classid?>, <?=$id?>,1); getComPage( <?=$classid?>, <?=$id?>,1); } 求助~~JavaScript的字符串中取特定的子串 没有跨域 ajax没有权限 焦急中.... 两个页面引用同一个js文件,怎么样用js文件取两个页面的DOM元素 Javascript如何知道返回的Dictionary的元素的个数? 各位过来看一下,DATAGRID的JS问题 如何在页面任意位置自动执行函数?? div和js之间调用的问题,高手帮忙 求教JAVASCRIPT的高手? 关于iframe的问题 为什么鼠标状态改变了 。。。。。。 revealTrans滤镜在哪些浏览器中被支持?除了Flash,还有什么可以替代? 难倒了,为什么左漂图片放在网上去就不漂浮了
window.onload=getComList( <?=$classid?>, <?=$id?>,1);
</script> ---------------------------------这是两个函数
function getComPage(classid,id,pagenum){
var url = '/e/ajax/index.php?';
var params ='action=getComPage' + '&classid=' + classid + '&id=' + id + '&pagenum=' + pagenum;
url+=params;
var functionName=function (){
if(xmlHttp.readyState==4){
if(xmlHttp.status==200){
if(xmlHttp.responseText!=0){
alert(xmlHttp.responseText);
$(".comnav1").html(xmlHttp.responseText);
}
else {
$(".comnav1").html("");
}
}
}
};
makeRequest(url, functionName, "GET", '');
}
function getComList(classid,id,pagenum){
var url = '/e/ajax/index.php?';
var params ='action=getComList' + '&classid=' + classid + '&id=' + id + '&pagenum=' + pagenum;
url+=params;
var functionName=function (){
if(xmlHttp.readyState==4){
if(xmlHttp.status==200){
if(xmlHttp.responseText!=0){
$("#commentinfo").html(xmlHttp.responseText);
}
else {
$("#commentinfo").html("");
}
}
}
};
makeRequest(url, functionName, "GET", '');
getComPage( <?=$classid?>, <?=$id?>,1);//调用
}
试一下 看看
你这写法不对的
onload=function()
{
getComList( <?=$classid?>, <?=$id?>,1);
getComPage( <?=$classid?>, <?=$id?>,1);
}