當ajax都完成后執行方法


<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title></title>
</head>

<body>
<script src="./jquery.min.js"></script>
<script>
var ajax6 = $.ajax({
url: './res1.php',
type: "post",
success: function(paramResponse) {
//console.log(paramResponse);
alert(paramResponse);
}
});

var ajax7 = $.ajax({
url: './res2.php',
type: "post",
success: function(paramResponse) {
alert(paramResponse);
}
});

$.when(ajax6, ajax7).done(function() {
//所做操作
alert("sss");
});
</script>
</body>

</html>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2024 CODEPRJ.COM