getJSON timeout handling

后端 未结 6 1031
借酒劲吻你
借酒劲吻你 2021-02-12 10:36

I am using jQuery getJSON() function. This function getting data with no problem. But sometimes waiting, waiting waiting... And my loading bar showing loading loadi

6条回答
  •  抹茶落季
    2021-02-12 11:22

    getJSON() is just a shorthand for the following:

    $.ajax({
        dataType: "json",
        url: url,
        data: data,
        success: success
    });
    

    So you could use $.ajax() and specify the timeout option as desired. See also: http://api.jquery.com/jQuery.getJSON/

提交回复
热议问题