$.PeriodicalUpdater.stop();
...gives me...
TypeError: Result of expression '$.PeriodicalUpdater.stop' [undefined] is not a function.
I've checked an double checked the owner's manual, I cannot figure out why this isn't working correctly. The error is harmless for the most part, it's just the user's browser won't stop making server calls that it no longer needs.
Thanks!
The doc says
The function call returns a handle. You can call .stop() on this handle in order to stop the updating and ignore any subsequent responses. If the maximum number of calls, .stop(), or the autoStop has been triggered, you can restart the updater using .restart() on the handle. This handle is also passed into the callback function as the fourth argument.
so it should be
var handle =$.PeriodicalUpdater(url, options);
handle.stop();
EDIT - after your comments, try
$.PeriodicalUpdater( url, { options, function(remoteData, success, xhr, handle){
if(condition){
handle.stop();
}
});
from manual
The function call returns a handle. You can call .stop() on this handle [...]
I think you must call stop() on handle.
ex:
var handle = $.PeriodicalUpdater('path',{},func);
handle.stop();
That's the context in which I'm using PU.stop(), does that change anything? It feels weird declaring a whole different PU inside the function of the PU I need to stop... What do you think? Thanks for your response, btw - NominalAeon 2012-04-04 17:56
That's the context in which I'm using PU.stop(), does that change anything? It feels weird declaring a whole different PU inside the function of the PU I need to stop... What do you think? Thanks for your response, btw - NominalAeon 2012-04-04 17:55