Hi,
I have an application that has a "parent" window. In the parent window there are menu items, like the following (using PHP here):
// sample link
echo "<li><a href=\"#\" onclick=openurl('covershift.php');>Shift Coverage</a></\
li>";
// logout link
echo "<li><a href=\"#\" onclick=openurl('logout');>Logout</a></li>";
Each link opens the appropriate page in a different "child" window. When the parent closes all of the child windows must close. I have implemented this functionality with Javascript, here is the function:
var childWindow = new Array();
var windowCount = 0;
function openurl(url)
{
if(url != 'logout') {
childWindow[windowCount]=window.open(url,'_blank','height=600,width=800,scr\
ollbars=1');
windowCount++;
if (window.focus) {
childWindow.focus();
}
} else {
var iCount;
for (iCount=0; iCount < windowCount; iCount++) {
if ((childWindow[iCount] != null) && !(childWindow[iCount].closed)) {
childWindow[iCount].close();
}
}
window.location='logout.php';
}
}
Here is my problem, when a user reloads the parent window and then clicks logout, the child windows remain open. This makes sense as the childWindow array is lost when the parent reloads.
How can I make the childWindow array persistent through a reload?
Thanks!