How do I subscribe to a method in jQuery?
<p>I would like to do something like this.</p>

<pre><code>var foo = function() {
    this.run = function() {
        alert('got');
    }
    this.init = function() {
        this.run();
    }
    this.init();
};

window.onload = function() {
    var f = new foo();
    $(f).bind('run', function() { // this doesn't work
        alert('ran!');
    });
};​
</code></pre>

<p>It doesn't work though. How can I subscribe to a method of another object?</p>
