AJAX - The Complete Reference

(avery) #1

234 Part II: Developing an Ajax Library^


times to retry a request. A callback bound to onRetry will be invoked in case there is a need
in performing some action every time a request is retried. The callback specified by
onTimeout will only be called if every retry fails.

var options = { method: "GET",
timeout : 3000,
retries : 4,
onRetry : showRetry,
onTimeout : showFailure,
onSuccess : showResponse
};

FIGURE 6-1 Don’t wait forever--timeout!
Free download pdf