Is it possible to cancel the DOM write to the element passed to Ajax.Updater? I didn''t see anything in the documentation, and I''d like to use this instead of Ajax.Request. There are situations where the results that are returned will not be what is expected, and I have no control over this. For this reason, I''d like to be able to cancel writing to the DOM. Thanks in advance. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
yes, it''s in the manual... http://prototypejs.org/api/ajax/updater notice the bottom 2 examples On Nov 20, 2007 5:51 PM, semi-sentient <momo-NzLVX5/4CHEAvxtiuMwx3w@public.gmane.org> wrote:> > Is it possible to cancel the DOM write to the element passed to > Ajax.Updater? I didn''t see anything in the documentation, and I''d like > to use this instead of Ajax.Request. There are situations where the > results that are returned will not be what is expected, and I have no > control over this. For this reason, I''d like to be able to cancel > writing to the DOM. > > Thanks in advance. > > >--~--~---------~--~----~------------~-------~--~----~ 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 read that, but I''m not sure how that is going to work in my
situation. I have a variety of elements that are written to when I
make a call to Ajax.Updater, and most of these requests are succeeding
(meaning onSuccess "fires").
What I basically need is a way to do the following:
onSuccess: function(r) {
if (isNaN(parseInt(r.responseText))) {
// do not write to the element passed in...
}
},
On Nov 20, 5:11 pm, "Brian Williams"
<brianw1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> yes, it''s in the manual...
>
> http://prototypejs.org/api/ajax/updater
>
> notice the bottom 2 examples
>
> On Nov 20, 2007 5:51 PM, semi-sentient
<m...-NzLVX5/4CHEAvxtiuMwx3w@public.gmane.org> wrote:
>
>
>
> > Is it possible to cancel the DOM write to the element passed to
> > Ajax.Updater? I didn''t see anything in the documentation, and
I''d like
> > to use this instead of Ajax.Request. There are situations where the
> > results that are returned will not be what is expected, and I have no
> > control over this. For this reason, I''d like to be able to
cancel
> > writing to the DOM.
>
> > Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Why don''t you want to use Ajax.Request?
var updateIfNumber = function(container, url, options) {
options = options || {};
options.onComplete = function(t) {
if (!isNaN(parseInt(r.responseText)))
$(container).update(r.responseText);
}
new Ajax.Request(url, options);
}
Best,
-Nicolas
On Nov 20, 2007 9:18 PM, semi-sentient
<momo-NzLVX5/4CHEAvxtiuMwx3w@public.gmane.org> wrote:
>
> I read that, but I''m not sure how that is going to work in my
> situation. I have a variety of elements that are written to when I
> make a call to Ajax.Updater, and most of these requests are succeeding
> (meaning onSuccess "fires").
>
> What I basically need is a way to do the following:
>
> onSuccess: function(r) {
> if (isNaN(parseInt(r.responseText))) {
> // do not write to the element passed in...
> }
> },
>
> On Nov 20, 5:11 pm, "Brian Williams"
<brianw1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > yes, it''s in the manual...
> >
> > http://prototypejs.org/api/ajax/updater
> >
> > notice the bottom 2 examples
> >
> > On Nov 20, 2007 5:51 PM, semi-sentient
<m...-NzLVX5/4CHEAvxtiuMwx3w@public.gmane.org> wrote:
> >
> >
> >
> > > Is it possible to cancel the DOM write to the element passed to
> > > Ajax.Updater? I didn''t see anything in the
documentation, and I''d like
> > > to use this instead of Ajax.Request. There are situations where
the
> > > results that are returned will not be what is expected, and I
have no
> > > control over this. For this reason, I''d like to be able
to cancel
> > > writing to the DOM.
> >
> > > Thanks in advance.
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---