Yes, in this case use Ajax.Request: http://www.prototypejs.org/api/ajax/request
..then just use setTimeout to keep calling the function periodically.
On Aug 28, 1:12 pm, S <[EMAIL PROTECTED]> wrote:
> Yes, I'm a newbie in using Ajax and I don't use javascript a lot
> either ( I didn't even know what JSON was :P ). I was trying to save
> the value returned by Ajax.PeriodicalUpdater, which I realized later
> that it's not gonna work. It only updates the value inside div
> directly. In that case, I'm forced to go to a totally different
> direction. Thanks Diodeus and Michael for your suggestions. I really
> appreciate it :)
>
> On Aug 27, 3:30 pm, Diodeus <[EMAIL PROTECTED]> wrote:
>
> > While I generally use JSON myself, judging from the skill level of the
> > original poster, I would expect JSON would be a bit of a leap.
>
> > On Aug 27, 3:17 pm, Michael Peters <[EMAIL PROTECTED]> wrote:
>
> > > Diodeus wrote:
> > > > Create some sort of unique delimiter in your responsedatastring to
> > > > separate the elements, such as "~".
>
> > > You could do that, but then you're limiting yourself (limiting yourself
> > > to just
> > > arrays and whatdatacan be in those arrays). Why not just use JSON? Convert
> > > your PHP structure (array or hash) into a JSON string and then send it
> > > over the
> > > wire.
>
> > > > Then turn the string into an array using (use your own variable
> > > > names):
>
> > > > mydata = myResponseText.Split('"~")
>
> > > > mydata[0] will contain the first element, mydata[1] the second etc.
>
> > > This would then become
>
> > > mydata = myResponseText.evalJSON();
>
> > > --
> > > Michael Peters
> > > Developer
> > > Plus Three, LP- Hide quoted text -
>
> > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
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
-~----------~----~----~----~------~----~------~--~---