Quantcast
Channel: JavaScript: Add delay to a jquery ajax retry - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Answer by David for JavaScript: Add delay to a jquery ajax retry

$
0
0

The context of this has changed by the time that retry() function executes, and is no longer the AJAX info. You should, however, be able to wrap it in a closure by using a variable:

var self = this;
var retry = function () {
    $.ajax(self);
};

(Note that this whole context is itself also happening in a callback, error. So if this still isn't what you need it to be, you may need to apply this same concept another scope higher.)


Viewing all articles
Browse latest Browse all 2

Trending Articles