これが私の現在のコードですが、closeWindow
関数は新しいタブが開く前に実行されます。
$(document.body).append('<iframe width="500px" height="500px" id="pcl_frame" style="display:none;"></iframe>');
$('#pcl_frame').attr('src', data['url']);
$('#pcl_frame').load(function() {
// Load page
document.getElementById('pcl_frame').contentWindow.CreateCBTPlayer(data['code'],"new");
// Close current windows after the above tab/window opens
closeWindow(); // has a 2 second delay
});
上記のコマンドが最初に新しいタブ/ウィンドウを開くのを待ってから、新しいウィンドウを開くために使用された現在のタブを閉じる方法はありますか?
また、CreateCBTPlayer
機能を変更することはできません。
免責事項
私がしていることはあまり論理的ではないことは知っていますが、それは私が使用しなければならない古いシステムを回避するために行われなければなりません。