Hey Mr. Newton,

Unfortunately the function used as the success call back has to be
passed-in already bound to another class with arguments already closed
to it.

So, it really ends up being just a variable like 'callback' passed-in
for the success function. So, in one class the success function is
bound with arguments and then passed to another class. So, the
wrapping is not really going to help. I still need to pass in an
argument to a function that has already been bound with arguments. If
no one has an answer off the top of their head, then I can figure it
out. I just thought I might be able to get an answer without going
"under the hood" ;)

Thank you,

doubleTap

On Nov 30, 6:24 pm, Aaron Newton <[email protected]> wrote:
> You have to wrap it.
>
> onSuccess: function(x, y, z) {
>   this.myfunc(x, y, z, {'bob': 'sally'}); //or whatever
>
>
>
> }.bind(this)
> On Tue, Nov 30, 2010 at 5:55 PM, doubleTap <[email protected]> wrote:
> > I have a function in a class like
>
> > myfunc:function() { some fun statements; }
>
> > Then I use it as a call back in an ajax call like
>
> > new Request({url:opts.uri, onSuccess:this.myfunc.bind.(this,
> > {'bob':'sally'}) }).send();
>
> > Now in my case I am running it all works fine except for the argument
> > I am passing in the bind. My essential question is: How do I bind
> > arguments to a function in a way that allows for additional arguments
> > to be passed to it when called?
>
> > In this case the call would be receiving the server response on
> > success of the ajax request. I know I have done it before but I think
> > I lost that part of my brain to mardi gras last year.

Reply via email to