On 9/11/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> On 9/11/07, Matej Knopp <[EMAIL PROTECTED]> wrote:
> > It's not a typo. It's javascript :-)
>
> I was afraid someone would say that :)
>
> b.onclick.bind(b)() <-- the second pair of parenthesis, what does that mean?

Okay, it goes like this:
b.onclick is the handler method
b.onclick.bind(b) actually wraps the previous in method, that passes
"b" as this. so b.onclick.bind(b) generates a method.
and the extra () invoke the method.

-Matej

>
> Eelco
>

Reply via email to