The scriptaculous calls merely generate JavaScript that will eventually be
sent to the client. Your RJS file is executed and rendered by the server,
all your system() calls will happen now, and the JavaScript required to
produce the effects on the frontend will have been generated -- _not_
executed. The generated code is then sent to the client (your browser) where
it is then executed and you see the fancy effects.
You''ll need to perform some ajax calls from the frontend that respond
with
RJS to trigger the system() calls on the server. You''ll need one ajax
call
per system() call (unless you group them up) which will obviously take quite
a while with any more just a couple of remote calls. Not to mention that
you''ll need to keep and eye out for clients that don''t perform
the full
number of requests that you''d expect.
My advice is to keep your design as simple as possible, it sounds like
you''re going to end up with a lot of complex code just for the benefit
of
having effects fire in "real" time.
On 08/01/07, Xeph <kishyr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
>
> Hi
>
> I have an RJS file that has scriptaculous page calls and system()
> function calls. They''re in the order of system(), scriptaculous,
> system(), system(), scriptaculous. It seems that all the system()
> functions get executed first, then the scriptaculous effects. Is there
> anyway to have my code get executed in the original order? For example,
> the first system call stops a recording, and first scriptaculous call
> displays a "saving" <div> tag; the other two system() tag
saves the
> recording, and the final scriptaculous call displays a "recording
> completed" <div> tag.
>
> Any help is appreciated
> Xeph
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---