Hi all! Please, can you try this url?: http://www.sistes.net/onComplete I write this very simple test to show you an Ajax.Updater firing onComplete before update the content of the affected object Is this a normal behaviour? (I suspect doesn''t) A bug? Thanks! -- Mis Cosas: http://blogs.sistes.net/Garito --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2007-Jun-28 06:40 UTC
Re: Ajax.Update raises onComplete before finish the update
Garito a écrit :> I write this very simple test to show you an Ajax.Updater firing > onComplete before update the content of the affected objectYour code is flawed. What you''re actually doing is: 1. Avaluate alert(''completo'') -> pops up the message 2. Assign the result of it to your onComplete option (i.e. undefined) 3. Finally call the new Ajax.Updater with the options object You must *pass* a function to callback options, not *call* a function. Try this: new Ajax.Updater(yourURLhere, { // your other options here onComplete: function(xhr) { alert(''Completo''); } }); -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Thank you so much! 2007/6/28, Christophe Porteneuve <tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org>:> > > Garito a écrit : > > I write this very simple test to show you an Ajax.Updater firing > > onComplete before update the content of the affected object > > Your code is flawed. What you''re actually doing is: > > 1. Avaluate alert(''completo'') -> pops up the message > 2. Assign the result of it to your onComplete option (i.e. undefined) > 3. Finally call the new Ajax.Updater with the options object > > You must *pass* a function to callback options, not *call* a function. > Try this: > > new Ajax.Updater(yourURLhere, { > // your other options here > onComplete: function(xhr) { > alert(''Completo''); > } > }); > > -- > Christophe Porteneuve a.k.a. TDD > "[They] did not know it was impossible, so they did it." --Mark Twain > Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org > > > >-- Mis Cosas: http://blogs.sistes.net/Garito --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---