Hi,
I have a web application that operates on several windows. Each window
is named win_1, win_2, win_3,... . When I quit a session, I usually
loop through all the windows and close one by one. So far so good
until my client wants to surf on 1 particular window and doesn't want
that window to close when a I quit a session.
I had something in mind:
find the window url through "window.locatio n.host" or something (I'd
save it as a global variable) and when I loop through my windows to
quit one by one, I thought I'd compare their host and if it is not
equal, I leave it open. I'm using the following codes at the moment:
_______________ __________
for($i=2;$i<=$w indow_number;$i ++) {
$str = "if (window.parent. name != 'win_'".$i."') {window.open
('','win_'".$i. "').close() ;}";
echo $str;
}
.....
echo "if (window.parent. name != 'win_1'){window .parent.close() ;}";
_______________ __________
Suppose win_3 has url "www.google.com ", how can I retrieve the host
name of win_3? Is it possible? Is there any easy way without having
recourse to major changes? I appreciate any suggestions.
Kind regards
Bils
I have a web application that operates on several windows. Each window
is named win_1, win_2, win_3,... . When I quit a session, I usually
loop through all the windows and close one by one. So far so good
until my client wants to surf on 1 particular window and doesn't want
that window to close when a I quit a session.
I had something in mind:
find the window url through "window.locatio n.host" or something (I'd
save it as a global variable) and when I loop through my windows to
quit one by one, I thought I'd compare their host and if it is not
equal, I leave it open. I'm using the following codes at the moment:
_______________ __________
for($i=2;$i<=$w indow_number;$i ++) {
$str = "if (window.parent. name != 'win_'".$i."') {window.open
('','win_'".$i. "').close() ;}";
echo $str;
}
.....
echo "if (window.parent. name != 'win_1'){window .parent.close() ;}";
_______________ __________
Suppose win_3 has url "www.google.com ", how can I retrieve the host
name of win_3? Is it possible? Is there any easy way without having
recourse to major changes? I appreciate any suggestions.
Kind regards
Bils
Comment