Grzesiek Slusarek wrote:
> Well that was only definition of the funcion, where it come from?
> I want to put param1 in the Ajax.Request object:
> var myAjax = new Ajax.Request(
>                       url,
>                       {method: 'get',
>                       parameters: pars,
>                       onComplete: showResponse;param1
>                       });
> Something like code above?
> But is it possible, is there a nice way to do This?

I think you can do something like this:

onComplete: (function(param1, transport, json) {
  // your code
}).bind(myAjax, 'value1');

They key here is that Function.bind allows you to set default 
parameters.  json is passed by respondToReadyState although it'll be 
undefined unless you're sending back X-JSON, so it could probably be 
dropped.

Todd

-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to