pennig
2007-09-18 17:03:00 UTC
I've noticed that inside Ajax.Request's respondToReadyState function,
when the readyState is "Complete", the onSuccess callback is called
before the onComplete callback.
This behavior affects how Ajax.Updater is run, and I was curious if
the execution sequence was a mindful decision.
The scenario I have is I am using Ajax.Updater to fill an element with
content, and in my onSuccess callback, I am running code that depends
on new content being in my element. Ajax.Updater does its HTML
insertion on the onComplete callback. What this means is that when
onSuccess runs, it doesn't know about the new content because the new
content hasn't actually been updated.
Would it be at all possible to switch around the order of execution in
respondToReadyState so that onSuccess (and hence, onFailure) to be
called after onComplete?
I know, at first glance, onComplete seems to be the most logical
choice of what to call _last_. I am just imagining that a good number
of people who use onSuccess with Ajax.Updater would expect to have the
new content be accessible at that time.
--~--~---------~--~----~------------~-------~--~----~
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-/***@public.gmane.org
To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
when the readyState is "Complete", the onSuccess callback is called
before the onComplete callback.
This behavior affects how Ajax.Updater is run, and I was curious if
the execution sequence was a mindful decision.
The scenario I have is I am using Ajax.Updater to fill an element with
content, and in my onSuccess callback, I am running code that depends
on new content being in my element. Ajax.Updater does its HTML
insertion on the onComplete callback. What this means is that when
onSuccess runs, it doesn't know about the new content because the new
content hasn't actually been updated.
Would it be at all possible to switch around the order of execution in
respondToReadyState so that onSuccess (and hence, onFailure) to be
called after onComplete?
I know, at first glance, onComplete seems to be the most logical
choice of what to call _last_. I am just imagining that a good number
of people who use onSuccess with Ajax.Updater would expect to have the
new content be accessible at that time.
--~--~---------~--~----~------------~-------~--~----~
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-/***@public.gmane.org
To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---