Rails Spinoffers: I need onComplete to run /after/ an Ajax.Request''s evalResponse(). I''m not sure why it runs before; is this an oversight, or do any applications out there need an onComplete that can access a page just before it updates? I need to access the updated state. If anyone else needs the current behavior, can we add an onFinal and run it after the evalResponse? Here''s my private tweak: if (state == ''Complete'') { if ((this.getHeader(''Content-type'') || '''').strip(). match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i)) this.evalResponse(); // avoid memory leak in MSIE: clean up this.transport.onreadystatechange = Prototype.emptyFunction; } try { (this.options[''on'' + state] || Prototype.emptyFunction)(transport, json); Ajax.Responders.dispatch(''on'' + state, this, transport, json); } catch (e) { this.dispatchException(e); } -- Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Siegfried Puchbauer
2007-Jan-16 15:56 UTC
Re: Tweak request for Ajax.Responders'' onComplete
hi i saw this changeset (commited 2 weeks ago) http://dev.rubyonrails.org/changeset/5843?new_path=spinoffs%2Fprototype%2FCHANGELOG hth sigi On 1/16/07, Phlip <phlip2005-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Rails Spinoffers: > > I need onComplete to run /after/ an Ajax.Request''s evalResponse(). I''m > not sure why it runs before; is this an oversight, or do any > applications out there need an onComplete that can access a page just > before it updates? I need to access the updated state. If anyone else > needs the current behavior, can we add an onFinal and run it after the > evalResponse? > > Here''s my private tweak: > > if (state == ''Complete'') { > if ((this.getHeader(''Content-type'') || '''').strip(). > match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i)) > this.evalResponse(); > > // avoid memory leak in MSIE: clean up > this.transport.onreadystatechange = Prototype.emptyFunction; > } > > try { > (this.options[''on'' + state] || Prototype.emptyFunction)(transport, > json); > Ajax.Responders.dispatch(''on'' + state, this, transport, json); > } catch (e) { > this.dispatchException(e); > } > > -- > Phlip > http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! > > > >--~--~---------~--~----~------------~-------~--~----~ 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 saw this changeset (commited 2 weeks ago) > > http://dev.rubyonrails.org/changeset/5843?new_path=spinoffs%2Fprototype%2FCHANGELOG > > hth > > sigiOookay. Can I have an onUpdate, to run after the evalResponse? (And isn''t the current onComplete really a "onResponse", because the transaction isn''t really complete yet!?) This feature is kind''a mission-critical... -- Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> > http://dev.rubyonrails.org/changeset/5843?new_path=spinoffs%2Fprototype%2FCHANGELOG> Oookay.Oops - I just parsed the changeset properly; it does what I need. Thanks, all!> (And isn''t the > current onComplete really a "onResponse", because the transaction > isn''t really complete yet!?)-- Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---