#12527 closed defect (fixed)
dojo.connect fails to bind 2 functions
Reported by: | zc | Owned by: | Kris Zyp |
---|---|---|---|
Priority: | low | Milestone: | 1.7 |
Component: | Documentation | Version: | 1.6.0 |
Keywords: | dojo.connect | Cc: | |
Blocked By: | Blocking: |
Description
It seems the documentation is messed up: http://docs.dojocampus.org/quickstart/events#connecting-functions-to-one-another says: "Connecting two global functions is even easier: objectConnections[1] = dojo.connect(foo, globalGuy);", This is not true. Example:
function foo() { console.log('foo'); }; function bar() { console.log('bar'); }; dojo.connect(foo, bar); foo();
Runnable example at http://jsfiddle.net/tNc5y/1/
Change History (4)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Owner: | set to Kris Zyp |
---|---|
Priority: | high → low |
severity: | major → minor |
Marking priority as low because presumably doing dojo.connect(null, foo, null, bar)
works.
comment:4 Changed 11 years ago by
Milestone: | tbd → 1.7 |
---|
Note: See
TracTickets for help on using
tickets.
You have to connect like this:
It is working correctly, although in docs there were typos which are now updated. If you do not use wrapping i.e. no wrap(head) in your example it is working correctly: http://jsfiddle.net/tNc5y/18/