我有Ajax請求的堆棧:異步Ajax請求是不是真的異步(jQuery和Zend公司)
$("someTable tr").each(function() {
// send the data.
var scriptURL = "/module/action/data/" + $(this).find(".data").html() + "/";
document.cyonVars.xhrPool[count] = $.ajax({
type: "GET",
url: scriptURL,
queue: "autocomplete",
cancelExisting: true,
dataType: 'json',
success: function(data){
// do something
}
}
});
count++;
})
雖然這些請求正在運行,用戶可以按下按鈕。這會觸發另一個Ajax請求。類似的東西:
var scriptURL = "/module/anotheraction/" +
data) + "/";
$.ajax({
type: "GET",
url: scriptURL,
queue: "autocomplete",
cancelExisting: true,
dataType: 'json',
success: function(data){
// Do another thing
}
});
來自第一個響應異步的動作的請求,我希望。當用戶觸發第二個請求時,等待其他請求完成。但第二個要求應該提前進行。我已經與session_write_close()一起工作沒有改變任何東西。感謝您的幫助。
謝謝。問題是zend會話。它在您調用zend_session :: start()時鎖定所有內容 –