RadarBob
10-23-2002, 06:03 PM
Has anyone seen this phenomenon?
I have two buttons, each of which spawns a child window. Here's the scenario:
Parent page displays
click on one of the buttons
child window opens normally
child window functions normally
click "finished"button, window closes
back on parent page, click that button again.
I get an error message on the browser status line "error on page"
The parent page seems to function normally
AAARRRGGG!
I can also do this exact same senario for the second button/window opening. In other words, the buttons work normally, but only the first time, only once.
If I refresh the mother page I can trigger the child page - but again, only once
Let me say that at one time this was all working perfectly! I could open/close the child window via the button all day long and it worked! But I must have sneezed when I was later editing the mother page, 'cause I don't know what the heck is going on!!! Maybe I deleted a return statement. Maybe I need to set the window object to null... I'm just guessing here..
Here is the relevant code on the mother page:
function openKeywordWindow (theform) {
if (typeof DBKeywordsWindow != "undefined") {
DBKeywordsWindow.focus();
}else{
DBKeywordsWindow = window.open("Keyword_Entry_Page.asp","AddKeywords",
"toolbar=no,menubar=no,location=no, directories=no,
width=500, height=400, resizable=yes, scrollbars=yes");
}
} // end openKeywordWindow()
function addReports() {
// just focus() if already open.
if ( typeof DBReportsWindow != "undefined") {
DBReportsWindow.focus();
}else{
DBReportsWindow = window.open("Reports_Entry_Page.asp","AddReports",
"toolbar=no,menubar=yes,location=no,directories=no,
width=700,height=400,resizable=yes,scrollbars=yes,
left=20,top=20,screenX=20,screenY=20");
}
// "left" & "top" work in Internet Explorer.
} // end openReportsWindow()
. . .
<input type="button" name="addKeywords" value=" Edit Keywords "
onclick="openKeywordWindow(document.DBForm)">
<input type="Button" name="NewReport" value=" Edit Reports "
onclick="addReports();">
Here is the code on the child pages that closes things out:
<input type="button" name="closewindow" id="closewindowIDEE"
value=" Finished " onclick="javascript: window.close()">
Below, "finished" passes data back to the parent page - that works.
function finished(theform) {
var e = theform.newList.options;
// handle that pesky "<-- empty -->" marker
if (e[0].value=='00') e[0]=null;
// clean out then rebuild the original keyword list in the parent window
window.opener.clearKeywordList();
// addKeyword function is on the parent page
for (var i=0; i <= e.length-1; i++) {
window.opener.addKeyword(e.options[i].text, e.options[i].text);
}
window.close();
} // finished()
. . .
<input type="button" name="closewindow" value=" Finished "
onclick="finished(this.form)">
I have two buttons, each of which spawns a child window. Here's the scenario:
Parent page displays
click on one of the buttons
child window opens normally
child window functions normally
click "finished"button, window closes
back on parent page, click that button again.
I get an error message on the browser status line "error on page"
The parent page seems to function normally
AAARRRGGG!
I can also do this exact same senario for the second button/window opening. In other words, the buttons work normally, but only the first time, only once.
If I refresh the mother page I can trigger the child page - but again, only once
Let me say that at one time this was all working perfectly! I could open/close the child window via the button all day long and it worked! But I must have sneezed when I was later editing the mother page, 'cause I don't know what the heck is going on!!! Maybe I deleted a return statement. Maybe I need to set the window object to null... I'm just guessing here..
Here is the relevant code on the mother page:
function openKeywordWindow (theform) {
if (typeof DBKeywordsWindow != "undefined") {
DBKeywordsWindow.focus();
}else{
DBKeywordsWindow = window.open("Keyword_Entry_Page.asp","AddKeywords",
"toolbar=no,menubar=no,location=no, directories=no,
width=500, height=400, resizable=yes, scrollbars=yes");
}
} // end openKeywordWindow()
function addReports() {
// just focus() if already open.
if ( typeof DBReportsWindow != "undefined") {
DBReportsWindow.focus();
}else{
DBReportsWindow = window.open("Reports_Entry_Page.asp","AddReports",
"toolbar=no,menubar=yes,location=no,directories=no,
width=700,height=400,resizable=yes,scrollbars=yes,
left=20,top=20,screenX=20,screenY=20");
}
// "left" & "top" work in Internet Explorer.
} // end openReportsWindow()
. . .
<input type="button" name="addKeywords" value=" Edit Keywords "
onclick="openKeywordWindow(document.DBForm)">
<input type="Button" name="NewReport" value=" Edit Reports "
onclick="addReports();">
Here is the code on the child pages that closes things out:
<input type="button" name="closewindow" id="closewindowIDEE"
value=" Finished " onclick="javascript: window.close()">
Below, "finished" passes data back to the parent page - that works.
function finished(theform) {
var e = theform.newList.options;
// handle that pesky "<-- empty -->" marker
if (e[0].value=='00') e[0]=null;
// clean out then rebuild the original keyword list in the parent window
window.opener.clearKeywordList();
// addKeyword function is on the parent page
for (var i=0; i <= e.length-1; i++) {
window.opener.addKeyword(e.options[i].text, e.options[i].text);
}
window.close();
} // finished()
. . .
<input type="button" name="closewindow" value=" Finished "
onclick="finished(this.form)">