[Dojo-interest] event.connect and function/method parameters

James Burke jburke at dojotoolkit.org
Tue Apr 18 18:50:04 MDT 2006


You need to use named functions (no anonymous functions, and no
strings of javascript). the following would work:

obj.myHelloMethod = function(){
  this.method('hello');
}

dojo.event.connect(handler, "onclick", obj, "myHelloMethod");

James

On 4/18/06, Nikolai Onken <nikolai at nikolaionken.com> wrote:
>
> Hey,
>
> I am not sure whether this is a JavaScript in general or Dojo only related
> question.
> How can I pass arguments to the methods called by event.connect?
> for example
>
> dojo.event.connect(handler, "onclick", obj, "method('hello')");
>
> doesn't seem to work. Is this possible though?
> Or how would I otherwise prevent having to write different functions/methods
> if I can't pass arguments?
> Cheers,
>
> Nikolai
> --
> View this message in context: http://www.nabble.com/event.connect-and-function-method-parameters-t1471596.html#a3979423
> Sent from the Dojo forum at Nabble.com.
>
> _______________________________________________
> Dojo FAQ: http://dojo.jot.com/FAQ
> Dojo-interest at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>


More information about the Dojo-interest mailing list