There is also a
I used to use this but implemented my own version of it with a cache and 
some hashing, it didnt take long to write and works perfectly


----- Original Message ----- 
From: "Aamchi" <>
To: "Prototype &" <>
Sent: Tuesday, June 23, 2009 11:19 PM
Subject: [Proto-Scripty] Re: Periodical Updater detect content change

Thanks, for your response. I'm not 100% sure if I understand correctly
what you mean. If I get some data and generate a hash and write this
to the JSON header and retrieve this when calling onSuccess, how will
I still have the previous hash? From where will I get this?  Won't the
updated data cause the hash to be overwritten in the JSON header? Or
do I have to send two hashes always and compare them?

On 23 Jun., 22:57, Richard Quadling <> wrote:
> 2009/6/23 Aamchi <>
> > Hi,
> > I was wondering if Ajax.PeriodicalUpdater can detect if content has
> > changed since the last update and if so trigger an event.
> > So for example I have a scoreboard which fetches data every 5 seconds
> > and displays this. I would be cool if there could be some kind of
> > notification if content had changed. I know that the new content is
> > stores in responseText but how can I compare it to the previous
> > content...
> > Thanks,
> > Aman
> Personally, I would do this server side.
> Assuming you get the data in some sort of structure before either rending
> some HTML and sending it or just sending it JSON'd, then you should be 
> able
> to build a hash of the data.
> See [1] for info on Hash Functions.
> So. If you sent the hash value in a X-JSON header along with an 
> onSuccess()
> callback, you can extract the hash from the second param to the onSuccess
> and compare this with the previously retrieved hash to indicate you've got
> changed data. See [2] for details about PeriodicalUpdater update
> notification and [3] for the parameters to common callbacks.
> Regards,
> Richard.
> [1]
> [2]
> <>[3]
> <>
> --
> -----
> Richard Quadling
> Zend Certified Engineer :
> "Standing on the shoulders of some very clever giants!"

You received this message because you are subscribed to the Google Groups 
"Prototype &" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to