javascript function pointer and "this"
        Posted  
        
            by 
                Justin808
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Justin808
        
        
        
        Published on 2013-06-30T04:11:00Z
        Indexed on 
            2013/06/30
            4:21 UTC
        
        
        Read the original article
        Hit count: 198
        
I'm passing a method as a variable to be used as a callback. When its called, the "this" is not the object the method is a member of. How do I go about getting access to the method's object instance so I can get access to it variables and other member functions?
I have no control over the callback call method, its a separate library. All I do is call the binding from my object init method. I would have expected this inside my _connection method to have been its object.
jsPlumb.bind('connection', this._connection);
© Stack Overflow or respective owner