JQuery ajax call default timeout value

后端 未结 4 1325
猫巷女王i
猫巷女王i 2020-12-01 06:08

I got a bug report that I can\'t duplicate, but ajax-call timeout is the current best guess.

So I\'m trying to find out the default value for timeout of a jQuery

4条回答
  •  不思量自难忘°
    2020-12-01 06:42

    As an aside, when trying to diagnose a similar bug I realised that jquery's ajax error callback returns a status of "timeout" if it failed due to a timeout.

    Here's an example:

    $.ajax({
        url: "/ajax_json_echo/",
        timeout: 500,
        error: function(jqXHR, textStatus, errorThrown) {
            alert(textStatus); // this will be "timeout"
        }
    });
    

    Here it is on jsfiddle.

提交回复
热议问题