getJSON timeout handling

后端 未结 6 1093
抹茶落季
抹茶落季 2021-02-12 10:25

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:12

    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/

提交回复
热议问题