任何人都知道是否可以让 PeriodicalUpdater 将它收到的数据传递给我分配的函数以更新所需的字段?
我想处理我收到的数据,然后让 PeriodicalUpdater 函数更新字段。
最佳答案
是的,您可以向它传递一个 onsuccess 回调,就像您对任何其他 AjaxRequest 所做的那样。
new Ajax.PeriodicalUpdater('container', '/someurl', {
method: 'get',
frequency: 3,
decay: 2;
onsuccess: function(response){
myCustomFunction(response.responseText);
}
});
function myCustomFunction(data){
/* do something */
}
关于javascript - prototype.js Ajax.PeriodicalUpdater 调用自己的函数更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/875808/