Why js function works inside of another function but not alone
<p>I have these two functions below and for whatever reason the windowedBox function only works when I call it from another function. If I directly call windowedBox(), it wont do anything. If I call getShareButtons(), it calls windowedBox() and works correctly. If anyone knows why this is happening, please help me. :(</p>

<p>NOTE:: if you're wondering why it says $j and not $ its because i set it up that way.</p>

<pre><code>function getShareButtons(){
    var postPath = window.location.pathname;
    var videoTitle = 'asdf';
    var videoURL = 'asdf';

    //Output social button attributes
    $j(".facebook-share").attr('href', 'asdf');
    windowedBox(); &lt;---THIS CALL WORKS
}

function windowedBox() { 
    $j(".facebook-share, .twitter-share").click(function(){
        window.open(this.href, videoTitle, "width=626, height=436", "status=0", "toolbar=0");
        return false;
    });
}
</code></pre>
