Ajax effects

Hi,

i was wondering if there was some kind of general line of code i could
add to my application, anywhere i suppose, that would generate some kind
of effect to notify the user that an effect is happening…it could be a
box on the top of the screen or something, that would be like the small
bar at the end of the browser that shows the user the status of a
loading page … i was hoping instead of going to each specific place i
put ajax on a page, i could just add a
when @HTTPrequest == something(or something similar) then javascript
Effect (or something)
(and not going to every specific place and do :complete => …etc)

is this even possible?

thanks…

: )

I have a link that does some background processing so I used :-

<%= link_to_remote(“Link Name”, :url => {:action => ‘link_action’},
:before => %(Element.show(‘spinner’)),
:success => %(Element.hide(‘spinner’))) %>
<%= image_tag ‘spinner.gif’, :id => ‘spinner’, :style => ‘display:
none;’ %>

in the view. All this does is display an animated spinner.gif when
the job is running. It’s then hidden when it’s finished.

If you have the Agile Web D. with Rails book then there is a
similar example on page 403.

Carl

I Heard Decay wrote:

  		:before  => %(Element.show('spinner')),
  		:success => %(Element.hide('spinner'))) %>

Dear Decay heard,

thank you for your reply. much appreciated.
the deal is, i’ve got around six/seven ajax actions on a certain page
(including ajax forms and such) and i was hoping that instead of going
to each one and putting a :before/:complete/:success on each one, there
was a different approach, like writing down HTTP_REQUEST/something or
some kind of command that recognizes the action taking place an ajax
one(if there is such a command, and i do believe there is one) and then
putting a general effect on that (that will take place on each ajax
command taking place)

if this is not possible, so be it…i’ll implement the effects one by
one, but i was hoping there was a different approach to it. is there? i
may be wasting my time…either way,

thanks for the reply,

unknown

Hi –

On Sun, 9 Jul 2006, unknown wrote:

was a different approach, like writing down HTTP_REQUEST/something or
some kind of command that recognizes the action taking place an ajax
one(if there is such a command, and i do believe there is one) and then
putting a general effect on that (that will take place on each ajax
command taking place)

if this is not possible, so be it…i’ll implement the effects one by
one, but i was hoping there was a different approach to it. is there? i
may be wasting my time…either way,

An RJS template maybe?

David


http://www.rubypowerandlight.com => Ruby/Rails training & consultancy
Ruby for Rails => RUBY FOR RAILS, the Ruby book for
Rails developers
http://dablog.rubypal.com => D[avid ]A[. ]B[lack’s][ Web]log
[email protected] => me

An RJS template maybe?

David

…maybe. how do i do this? any info i could get my hands dirty with?
i’ve seen RJS all around, but don’t really know what it’s all about…?
thanks,

unknown

unknown [email protected] writes:

An RJS template maybe?

David

…maybe. how do i do this? any info i could get my hands dirty with?
i’ve seen RJS all around, but don’t really know what it’s all about…?
thanks,

There is a book on RJS buy that. Or search around in blogosphere for
articles
explaining RJS.

HTH.

Surendra S.
http://ssinghi.kreeti.com, http://www.kreeti.com
Read my blog at: http://cuttingtheredtape.blogspot.com/
,----
| “War is Peace! Freedom is Slavery! Ignorance is Strength!”
| – Orwell, 1984, 1948
`----

Take a look at this plugin. It might accomplish what your looking for.

http://www.agilewebdevelopment.com/plugins/remote_helpers

I believe its an extension to the link_to_remote et al rail functions.

Cheers,
Adam