How do I call a function on every update? Below is what I tried. It doesn't work. The function itself works fine when I execute it alone.
new Ajax.PeriodicalUpdater('chatMessages', 'chat/receive_chat',
{
method: 'post',
parameters: {lId: latestId},
insertion: Insertion.Bottom,
frequency: 2,
decay: 2,
Onsuccess: val = function(){$('chatMessages').scrollTop = $('chatMessages').scrollHeight;}
});
Is this as simple as a case-sensitivity issue?
You have:
Onsuccess: function(){...}
Should it be:
onSuccess: function(){...}