如题 两个function 单独都可以运行没问题 写一起就只有changepage运行 $(document).ready(function(){
changepage(1);
uptop(1);
});
function uptop(pid){
$.post("aa.php?pid="+pid,function(data){
$("#"+pid).html(data);
});
}
function changepage(page){
$.post("bb.php?page="+page,function(data){
$("#test").html(data);
});
}
changepage(1);
uptop(1);
});
function uptop(pid){
$.post("aa.php?pid="+pid,function(data){
$("#"+pid).html(data);
});
}
function changepage(page){
$.post("bb.php?page="+page,function(data){
$("#test").html(data);
});
}
changepage(1);
uptop(1);
function uptop(pid){
$.post("aa.php?pid="+pid,function(data){
$("#"+pid).html(data);
});
}
function changepage(page){
$.post("bb.php?page="+page,function(data){
$("#test").html(data);
});
}
});
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://www.wanmei.com/public/js/jq_132.js"></script>
</head>
<body>
<script>
$(document).ready(function(){
changepage(1);
uptop(1);
});
function uptop(pid){
$.post("aa.php?pid="+pid,function(data){
$("#"+pid).html(data);
});
alert(pid)
}
function changepage(page){
$.post("bb.php?page="+page,function(data){
$("#test").html(data);
});
alert(page)
}</script>
</body>
</html>没问题,可以执行啊
这些写之后 pid 返回的是 undefinde
那是后台没返回数据吧?ajax的问题?
ajax应该没冲突吧~·请求的是两个页面