I was reading the docs for Ajax.Updater and it mentions that onComplete gets called after the update takes place. The same doesn''t seem to be true for the onSuccess callback (unless I''m mistaken). Perhaps a note of this should be made in the documentation? [background: I was attempting to attach event handlers to elements added via updater in the onSuccess callback, and it was failing as the elements didn''t exist - moved it to onComplete and it worked] -- Chris --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I was reading the docs for Ajax.Updater and it mentions that onComplete gets called after the update takes place. The same doesn''t seem to be true for the onSuccess callback (unless I''m mistaken). Perhaps a note of this should be made in the documentation? [background: I was attempting to attach event handlers to elements added via updater in the onSuccess callback, and it was failing as the elements didn''t exist - moved it to onComplete and it worked] -- Chris --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
OnSuccess happens the moment that the Updater connects to the server or whatever it''s contacting. It''s that kind of success, not the success of finishing something. Walter On May 16, 2007, at 11:07 AM, crispygoth wrote:> > I was reading the docs for Ajax.Updater and it mentions that > onComplete gets called after the update takes place. The same doesn''t > seem to be true for the onSuccess callback (unless I''m mistaken). > Perhaps a note of this should be made in the documentation? > > [background: I was attempting to attach event handlers to elements > added via updater in the onSuccess callback, and it was failing as the > elements didn''t exist - moved it to onComplete and it worked] > > -- > Chris > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hey Walter, Walter Lee Davis a écrit :> OnSuccess happens the moment that the Updater connects to the server or > whatever it''s contacting. It''s that kind of success, not the success of > finishing something.Sorry to say, but 100% wrong. onSuccess is a Prototype-based event that triggers alternatively to onFailure *right before* onComplete, based on the analysis of the HTTP response status code ([200;300[). It''s in the docs: http://prototypejs.org/api/ajax/options Now the onSuccess/onFailure/onComplete events work fine with me on A.R and A.U, so can the OP please put some reproducible case online, making sure they use the latest public Prototype (1.5.1 final)? -- 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 -~----------~----~----~----~------~----~------~--~---
> : I was attempting to attach event handlers to elements added via updaterI notice this too with Ajax.updater, if you add any DOM elements to the div you are updating, anything triggered by onSuccess they may not necessarily exist yet, but with onComplete the elements have been drawn and you can manipulate them.. so like this fails: new Ajax.Updater( ''products_div'', ''/some_url'', { method: ''get'', onSuccess: { // do stuff to elements inside products_div } }); but replace onSuccess with onComplete and you''re good to go.. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On May 17, 2007, at 1:18 AM, Christophe Porteneuve wrote:>> OnSuccess happens the moment that the Updater connects to the server >> or >> whatever it''s contacting. It''s that kind of success, not the success >> of >> finishing something. > > Sorry to say, but 100% wrong. > > onSuccess is a Prototype-based event that triggers alternatively to > onFailure *right before* onComplete, based on the analysis of the HTTP > response status code ([200;300[).Okay, I see what you mean, but I have to say, not entirely 100% wrong either. Status headers are the very first thing that a Web server sends in response to a request. They are the conversational equivalent of clearing your throat before you start speaking. You may then follow that by a mighty pause before saying something extremely clever (or mistaken, if you are me). From the point of view of the receiving script, a status 200 will trigger onSuccess, but that doesn''t mean that the rest of the data has come along. It just means that the request was successful. That''s all I was trying to get across to the OP. Walter --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---