Ant*_*oCS 1 javascript ajax prototypejs
任何人都知道是否可以让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 */
}
Run Code Online (Sandbox Code Playgroud)
请参阅Ajax.PeriodicalUpdater和Ajax选项.