私のアプリケーションには、4 つのリンクがある新しいアプリケーションを開始するタブが 1 つあります。リンクをクリックすると、子ウィンドウが開きます。そのリンクから 2 つの子ウィンドウを開いたとします。ここで、新しいアプリケーションの開始をもう一度クリックし、リンクから他の 3 つの子ウィンドウを開きます。ログオフすると、親ウィンドウと最後に開いた 3 つの子ウィンドウのみが閉じられ、以前に開いた 2 つの子ウィンドウは閉じられません。閉めてほしい
子ウィンドウが開いている場所からの私のコードは if(rowData.productVersion == "1001"){
childWindow[childWindow.length]=is1001Opened=window.open('/eApps/layout/multipleAppPage.jsp?windowID='+windowID+'&newTitle='+rowData.productCode+'¶mTemp='+uri_encode);
}else{
childWindow[childWindow.length]=window.open('/eApps/layout/multipleAppPage.jsp?windowID='+windowID+'&newTitle='+rowData.productCode+'¶mTemp='+uri_encode);
}
そして私のログアウトコードは
{
$('#'+id).click(function(event){
event.preventDefault();
$('#centerContent').load('<%=request.getContextPath()%>/'+target);
});
} else {
$('#'+id).click(function(event){
event.preventDefault();
var r=confirm("logout");
if (r==true) {
for (var i=0;i<childWindow.length;i++) {
if (childWindow[i] && !childWindow[i].closed)
childWindow[i].close();
}
window.close();
}
});
}