2009-05-18 73 views

回答

5

是的,您可以將它傳遞給onsuccess回調,就像您爲任何其他AjaxRequest一樣。

new Ajax.PeriodicalUpdater('container', '/someurl', { 
    method: 'get', 
    frequency: 3, 
    decay: 2; 
    onsuccess: function(response){ 
    myCustomFunction(response.responseText); 
    } 
}); 

function myCustomFunction(data){ 
    /* do something */ 
} 

Ajax.PeriodicalUpdaterAjax Options

+0

那麼有可能阻止它更新?我想我只是需要它來運行調用,而不是插入任何東西,因爲我需要更新的字段必須以非常特殊的方式更新 – AntonioCS 2009-05-18 10:15:05