Prototype.js Ajax.PeriodicalUpdater calls its own function to update
1 answer
Yes, you can pass an onsuccess callback to it as you would for any other AjaxRequest.
new Ajax.PeriodicalUpdater('container', '/someurl', {
method: 'get',
frequency: 3,
decay: 2;
onsuccess: function(response){
myCustomFunction(response.responseText);
}
});
function myCustomFunction(data){
/* do something */
}
See Ajax.PeriodicalUpdater and Ajax Parameters .
+5
a source to share