Re: Re: onComplete: handleSuccess - What gets passed?

Alex Duffield
Sat, 05 Aug 2006 19:01:01 -0000

Wonderful!!  Now I owe you a beer to!

Thanks :-)
______________________________________________________________________
Alex Duffield . Principal . InControl Solutions . http://
www.incontrolsolutions.com



On 5-Aug-06, at 10:43 AM, Eric Anderson wrote:

> Alex Duffield wrote:
>> Eric, thanks for the answer. I was hoping to be able to get the
>> options (parameters in particular)  that where used in the origian
>> request. Oh well. Ill find another solution.
>
> Hmmmm.... I guess I was not very clear. The following statement was
> the primary answer to your question:
>
> I wrote:
>>> Finally, all event handlers for the Ajax.Request object are
>>> executed in the context of the Ajax.Request object. That means
>>> that the "this" identifier can be used to query the
Ajax.Request
>>> object that made the request.
>
> Since your callbacks are executed in the context of the
> Ajax.Request object you can access the Ajax.Request object with the
> "this" identifier. The Ajax.Request object of course stores all
> your options (plus various other info). So if you want the
> parameters you can do:
>
> function mySuccess(transport, json) {
> 	alert(''Ajax request with parameters '' +
> 		this.options.parameters + '' finished executing'');
> }
> new Ajax.Request(url, {onSuccess: mySuccess});
>
> Eric
>
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs