sleep(5);
echo 1;
}
public function ajax2(){
sleep(1);
echo 2;
}
public function talk(){
$this->display();
}
--------------------------------------------------------------------------------
<!DOCTYPE html>
<html>
<head>
<ti
<sc
<sc
<sc
$(function(){
$('#1').click(function(){
$.ajax({
url:'/tp/index/ajax1',
type:'post',
success:function(e){
la
}
})
})
$('#2').click(function(){
$.ajax({
url:'/tp/index/ajax2',
type:'post',
success:function(e){
la
}
})
})
})
</sc
</head>
<body>
<input type="button" value="1" id="1">
<input type="button" value="2" id="2">
</body>
</html>
Thinkphp3.23
现在想在一个页面实现两个ajax请求,但是发现都是执行完一个ajax之后,才会开始执行另外一个,不是同时开始执行才对的吗
执行时间是ajax1是5s,ajax2是6s
最佳答案
