Hi,

I'm afraid your question doesn't make a lot of sense, I think a great
deal has been lost in translation.

But `this` is special in JavaScript: It's set entirely by *how a
function is called*, not *where a function is defined*. This is
different from other languages. More here:
http://blog.niftysnippets.org/2008/04/you-must-remember-this.html
http://api.prototypejs.org/language/function/prototype/bind/

HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com

On Nov 1, 8:14 pm, laurent barre <houpde...@gmail.com> wrote:
> Hi,
>
> I have a function Ajax.Responders , but i can't catch the paramater "this"
> and i can't modify the value of the parameter "this".
>
> the result>one : the value is 'url'
>
>  >two :  equal *"no_good"*
>
> > three : undefined
>
> I try to find a solution, I think that in javascript , the transfert of a
> global variable(this) is not possible, do you have a solution ? or a
> explication ?
>
> Code ----------------------------------------------------------------------
>
> *this.element = 'url';
> this message = 'no_good';
>
> trace(this.element);  > one
>
> Ajax.Responders.register({
>                 onComplete: function (xhr, json){
>                   if (json) {
>                     var str = '';
>                     json.each(function (item) {
>                           str += item.reponse;
>                         });
>                     this.message = str;  > two
>                     trace(this.element);  > three
>
>                   }
>                 }});
>
> *
> Code
> ------------------------------------------------------------------------
>
> thanks,
>
> Laurent

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to