I just struggled through (once again) trying to use PeriodicalUpdater
to do what it says on the label while making a prototype of a chat-
room application. It worked fine, as long as I was willing to accept
complete updates of the entire DIV full of posts. When I tried to
optimize the application to only return updates *newer than* the last
successful update, I could not figure out how to get a variable to
update within the context of the PU, and thus gave up and rolled my
own updater using PE.
var pollChat = function(){
new Ajax.Updater('posts','chat.php',{
parameters:{
latest:$('latest').value},
insertion:'bottom',evalScripts:true
}
);
}
pollChat();
new PeriodicalExecuter(pollChat,3);
This gets me the updated value of 'latest' every time, but doesn't
get me the decay behavior (unless I was to roll that myself as well).
So am I swimming upstream with PU here? Is this just not what it was
meant to do? I am mostly happy with the way I ended up here, but I'm
still curious why this was so hard in the first place.
Thanks in advance,
Walter
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---