以下にこれらの2つの関数がありますが、何らかの理由でwindowedBox関数は、別の関数から呼び出した場合にのみ機能します。windowedBox()を直接呼び出すと、何も実行されません。getShareButtons()を呼び出すと、windowedBox()が呼び出され、正しく機能します。なぜこれが起こっているのか誰かが知っているなら、私を助けてください。:(
注::私がそのように設定したので、なぜ$jではなく$jと表示されるのか疑問に思っている場合。
function getShareButtons(){
var postPath = window.location.pathname;
var videoTitle = 'asdf';
var videoURL = 'asdf';
//Output social button attributes
$j(".facebook-share").attr('href', 'asdf');
windowedBox(); <---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;
});
}