我正在使用PHP。我想完成jQuery AJAX過程,(完成過程並在數據返回主頁面後返回)。如何做一些jQuery後的其他jquery的事情ajax
然後做下一個jQuery的事情。任何想法如何做到這一點?
$.ajax({
url: "page1.php",
dataType: "html",
type: 'POST',
data: "value=" + value,
success: function(data){
//some process
}
});//ajax1
$.ajax({
url: "page2.php",
dataType: "html",
type: 'POST',
data: "value=" + value,
success: function(data){
//some process
}
});//ajax2
$.ajax({
url: "page3.php",
dataType: "html",
type: 'POST',
data: "value=" + value,
success: function(data){
//some process
}
});//ajax3
// finish all the 3 ajax process, do the below code
$(".page").css('display','block');
謝謝你分享! $ .when()似乎是非常方便的! – 2011-06-10 22:58:00
+1當!從來沒有聽說過它,我相信我會用這個:) – 2011-06-10 23:00:39
+1一個美妙的答案,謝謝。 – cj333 2011-06-10 23:02:18