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

Michael Peters
Sat, 05 Aug 2006 16:29:05 -0000

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.

You could just use a closure:

new Ajax.Request(
  url,
  {
    parameters: params,
    ...
    onComplete: function(response) {
      // you can access the ''params''
      // in here
    },
  }
);

Now, if you pass a function by name instead for your onComplete value, you can
just wrap it in an anonymous function like so

  onComplete: function(response) {
    // use ''params''
    yourOnComplete(response, ...);
  }

--
Michael Peters
Developer
Plus Three, LP