thanks thats a good idea and it works fine!
however, i am wondering if i would be able to invoke the onFailure
directly...

On 5 Apr., 16:58, Michael Peters <[EMAIL PROTECTED]> wrote:
> michal wrote:
> > i wonder if its possible to call the onFailure-"method" within the
> > onSucces (see the commented line within the onSuccess method). i tried
>
> > this.onFailure(transport)
> > onFailure(transport)
>
> Why not use a real function?
>
> function my_failure(transport) {
>   ...
>
> }
>
> new Ajax.Request(window.location.href, {
>     method         : 'post',
>     parameters     : params,
>     requestHeaders : {Accept: 'application/json'},
>     onSuccess      : function(transport) {
>     if (!transport.responseText.startsWith('root'))
>         my_failure(transport);
>     },
>     onFailure      : my_failure
>
> });
>
> --
> Michael Peters
> Developer
> Plus Three, LP


--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to