Ajax.PeriodicalUpdater does not extend from Ajax.Updater, so it does not
support the evalJSON, and other methods, is that correct?  So you are
limited in someways, with respect to Ajax.Request

Feel free to slap me around Chris (go easy though :)  )... I'd try this by
running a PeriodicalExecuter which called an Ajax.Request method.  Then
inside of the Ajax.Request parse the return JSON (or whatever return form
you are using), place the value in the target DIV, and also place the value
in a hidden Form element.  Each call of Ajax.Request at the specified
interval could then check the hidden Form value (last value updated), and
you could perform your comparison with the new value, then complete whatever
new DOM manipulation you intended if the val had changed.

(never used lastText, lastResponseText, but that seems more elegant than
placing it in a Form element.  Is the above method violate any best
practices?  I'm trying to always pass JSON, and Ajax.PeriodicalUpdater does
not allow that as far as I read.  Always would like to hear other options
myself)

cheers,
Mark

On 6/9/07, Christophe Porteneuve <[EMAIL PROTECTED]> wrote:
>
>
> Hey,
>
> Terry Riegel a écrit :
> > Using I am using the Ajax.PeriodicalUpdater, and it is working great.
> > How do I test to see if the content has changed from the last request?
>
> Well, why do you need to?  At any rate, it's a simple matter of saving
> the last responseText and comparing it to the new one.  It does keep it
> in its lastText property, btw.
>
> --
> Christophe Porteneuve a.k.a. TDD
> "[They] did not know it was impossible, so they did it." --Mark Twain
> Email: [EMAIL PROTECTED]
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to