1

I want to call 2 functions on a click event. I tried the below way but it didn't help, basically I would like to call get and refresh on click

dojo.connect(this.next, "onclick", "get");  
dojo.connect(this.next, "onclick", "refresh");

one way is to call a function which inturn calls get and refresh. But how do I achieve this....

3

1 Answer 1

1

Simply use function that call both get and refresh as below :

dojo.connect(this.next, "onclick", function(e) {
   get(e);
   refresh(e);
});

if you're using dojo >= 1.7 , you better use dojo/on for handling events,

your code would become : ( after importing "dojo/on" )

on(this.next, "click", function(e){
   get(e);
   refresh(e);
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.