Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#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 8 years ago by Maastermedia

You have to connect like this:

dojo.connect("foo", bar);

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/

comment:2 Changed 8 years ago by bill

Owner: set to Kris Zyp
Priority: highlow
severity: majorminor

Marking priority as low because presumably doing dojo.connect(null, foo, null, bar) works.

comment:3 Changed 8 years ago by Kris Zyp

Resolution: fixed
Status: newclosed

Fixed typo in docs

comment:4 Changed 8 years ago by bill

Milestone: tbd1.7
Note: See TracTickets for help on using tickets.