Hey guys,
what would be the best way to incorporate this into the builtin
link_to_remote() method?
document.getElementById(''main'').innerHTML = ''<img
src="/images/loading_small.gif">'';
Id like for the item above to take place while the page is loading.
I''m currently doing this with another javascript but would prefer to
use rails. Unfortunately, rails just sits there until the page loads.
Thank you
Mark Van Holstyn
2006-Jul-06 02:00 UTC
[Rails] link_to_remote method display a loading image?
i believe link_to_remote takes a :before and :after option which you can pass js to execute. mark On 7/5/06, x1 <caldridge@gmail.com> wrote:> > Hey guys, > > what would be the best way to incorporate this into the builtin > link_to_remote() method? > > document.getElementById(''main'').innerHTML = ''<img > src="/images/loading_small.gif">''; > > Id like for the item above to take place while the page is loading. > I''m currently doing this with another javascript but would prefer to > use rails. Unfortunately, rails just sits there until the page loads. > > Thank you > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Mark Van Holstyn mvette13@gmail.com http://lotswholetime.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060706/1ff998b2/attachment.html
I ended up adding a loading() function within prototype.js with this:
javascript:document.getElementById(''sleep3'').innerHTML =
''<img
src="/images/loading_small.gif">'';
and adding this to the rhtml:
<%= link_to_remote("Sleep 3", :url =>
"/templates/sleep3", :update =>
"test_div_01", :loading =>
"loading(''test_div_01'')" ) %>
works for me! :-) thanks
On 7/5/06, x1 <caldridge@gmail.com> wrote:> Hey guys,
>
> what would be the best way to incorporate this into the builtin
> link_to_remote() method?
>
> document.getElementById(''main'').innerHTML =
''<img
> src="/images/loading_small.gif">'';
>
> Id like for the item above to take place while the page is loading.
> I''m currently doing this with another javascript but would prefer
to
> use rails. Unfortunately, rails just sits there until the page loads.
>
> Thank you
>