Variable ajaxErrorHandler

ajaxErrorHandler: AjaxErrorHandler | undefined

Implements this function to be called if the request fails. The function receives four arguments: The XHR (XMLHttpRequest) object, a number describing the status of the request, a string describing the text of the status, and a number describing the retry value to re-send.

For example,

zAu.ajaxErrorHandler = function (req, status, statusText, ajaxReqTries) {
if (ajaxReqTries == null)
ajaxReqTries = 3; // retry 3 times

// reset the resendTimeout, for more detail, please refer to
// http://books.zkoss.org/wiki/ZK_Configuration_Reference/zk.xml/The_client-config_Element/The_auto-resend-timeout_Element
zk.resendTimeout = 2000;//wait 2 seconds to resend.

if (!zAu.confirmRetry("FAILED_TO_RESPONSE", status+(statusText?": "+statusText:"")))
return 0; // no retry;
return ajaxReqTries;
}

Param: req

the object of XMLHttpRequest

Param: status

the status of the request

Param: statusText

the text of the status from the request

Param: ajaxReqTries

the retry value for re-sending the request, if undefined means the function is invoked first time.

Since

6.5.2