我想打開一個報表頁面,以便從登錄時它應該進入主頁面,該頁面本身將在新窗口中打開。在主頁上,有兩個按鈕。點擊任何按鈕,它將在新窗口中打開與該按鈕相關的特定報告。關閉父窗口中的所有子窗口
現在,問題是每個報告頁面上都有一個鏈接應該返回到主頁面(即它應該最小化報告頁面)。另外,如果用戶再次打開第二個報告,它將在新窗口中打開並點擊鏈接到主頁面,它也應該最小化第二個報告窗口。
此外,還有3個頁面的註銷,即主頁,第一個報告和第二個報告。所以點擊從主頁面註銷應該關閉所有最小化窗口,如果有的話。點擊從其他任何頁面註銷,即其他報告,它應該使會話無效。
我的問題是我不能夠關閉第二子窗口時註銷從第一調用。另外,如果從主頁面調用註銷,如何關閉所有彈出窗口。
代碼,我使用從登錄打開主頁 -
function RedirectPage(path)
{
var intWidth = screen.width - 10; //Adjust for the end of screen
var intHeight = screen.height - 80; //Adjust for the Icon Bar at the bottom of the window.
var strWinProp = " toolbar=no" //Back, Forward, etc...
+ ",location=no" //URL field
+ ",directories=no" //"What's New", etc...
+ ",status=yes" //Status Bar at bottom of window.
+ ",menubar=no" //Menubar at top of window.
+ ",resizable=yes" //Allow resizing by dragging.
+ ",scrollbars=yes" //Displays scrollbars is document is larger than window.
+ ",titlebar=yes" //Enable/Disable titlebar resize capability.
+ ",width="+intWidth //Standard 640,800/788, 800/788
+ ",height="+intHeight //Standard 480,600/541, 600/566
+ ",top=0" //Offset of windows top edge from screen.
+ ",left=0" //Offset of windows left edge from screen.
+ "";
var win = window.open(path,'_blank',strWinProp);
self.setTimeout("closeMe()",500);
}
代碼從主頁打開報表 - 我使用打開報告2只是我
function report1() {
sessionId = getURLParameters('requestID');
userName = getURLParameters('userName');
userId = getURLParameters('userId');
lvalue = getURLParameters('lValue');
lver = getURLParameters('lVer');
window.name = "parent";
var intWidth = screen.width - 10; //Adjust for the end of screen
var intHeight = screen.height - 80; //Adjust for the Icon Bar at the bottom of the window.
var strWinProp = " toolbar=no" //Back, Forward, etc...
+ ",location=no" //URL field
+ ",directories=no" //"What's New", etc...
+ ",status=yes" //Status Bar at bottom of window.
+ ",menubar=no" //Menubar at top of window.
+ ",resizable=yes" //Allow resizing by dragging.
+ ",scrollbars=yes" //Displays scrollbars is document is larger than window.
+ ",titlebar=yes" //Enable/Disable titlebar resize capability.
+ ",width="+intWidth //Standard 640,800/788, 800/788
+ ",height="+intHeight //Standard 480,600/541, 600/566
+ ",top=0" //Offset of windows top edge from screen.
+ ",left=0" //Offset of windows left edge from screen.
+ "";
window.open(Url + userName + "&requestID=" + sessionId + "&userId="
+ userId + "&lValue=" + lvalue + "&lVer=" + lver,'_blank',strWinProp);
}
相同的代碼我正在使用不同的URL。
在點擊註銷從孩子我調用這個函數 -
function logout()
{
opener.location.href = '/Login.html';
close();
}
相同註銷功能用於第二個孩子的主頁
註銷功能 -
function onLogout(){
window.opener.location.reload(true);
window.opener.location.href=loginPageUrl;
window.close();
}
請make一個[mcve] – mplungjan