簡體   English   中英

使用Ajax可以在php中多次調用一個函數嗎?

[英]using Ajax can i call one function in many times in php?

我想從數據庫下載大數據,所以使用通過限制下載數據庫的ajax調用單個函數,

我可以通過這種方式將ex-66000記錄傳遞給ajax函數值20000、20000、26000並下載數據庫。

謝謝

好吧,我認為,您可以使用嵌套的AJAX類型結構。

當第一個函數完成其AJAX調用時,調用第二個函數。

像這樣的東西:

$.ajax({
type: 'GET',
url: "/dosomething",
cache: false,
dataType: "html",
data: { lowerbound:"0"; uperbound: "2000"} ,
success: function(html_input)
{
    $.ajax({
        type: 'GET',
        url: "/dosomething",
        cache: false,
        dataType: "html",
        data: { lowerbound:"2001"; uperbound: "4000"} ,
        success: function(html_input){
        alert(html_input);
        }
    });                                                                       
}
});

我使用了2次迭代。

另一種方法是,您可以將變量遞歸傳遞給函數並執行所需的任務。 這將幫助您使用n個時間縮放功能。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM