[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
I'm following up to my own response here. I tried doing what I suggested and I had it
almost right. The following HTML file presents two buttons ("open" and "close") The "open"
button, when clicked, opens a new winodw (w2) and writes HTML lines to it. The HTML which
is written to w2 simply creates a button ("ok") in the new window which, when pressed, will
call the main window's validate() function, passing it's own windowId. The validate
funtion will then close the calling window and pop up an alert indicating that it was
the new window. I had the following lines in the initWindow() function:
but I got errors when the '</SCRIPT>' line was encountered. I think that Netscape was
interpreting the </SCRIPT> in the write call as the end of the current script (instead of
just passing it into the write call), which is NOT what I intended.
I think this is what you were interested in. If not let me know.
-------------- EXAMPLE --------------
w2 = window.open(windowName);
windowId.document.write('<FORM name = "controlPanel">');
windowId.document.write('<INPUT type = "button" name = "okButton" value = "OK"
onClick = "mainWindow.validate(window)">');
windowId.mainWindow = window;
window.alert("Validate function called");
<input type = "button" name = "open" value = "Open" onClick = "w2 =
<input type = "button" name = "close" value = "Close" onClick = "w2.close()">
------------ END EXAMPLE ------------
Sr. Software Engineer
Science Applications International Corp (SAIC)
San Diego, Ca