This article is reproduced in: http://blog.csdn.net/fenglibing/archive/2007/09/11/1781243.aspx
1,Pass a value to the parent window from the Child WindowIf the parent page has a controlled ID choosedprovider, you can pass the value to the parent page: opener.doc ument. getelementbyid ("choosedprovider"]). value = "Tom ";2,Pass a value from the parent window to the Child Window. If the child window contains an IDTIn this case, you can use the following values:<SCRIPT> var newwindow; function OpenWindow (URL) {newwindow = too many open(“new.htm "," "," width = 400, Height = 300 ");} function changechild({{new}{doc ument. getelementbyid ("T "). value = "I changed" ;}</SCRIPT> first grabs the handle and then operates through the handle. In fact, compare the values transmitted from the Child window above to the parent window, the operation object is changed.3,Close the Child Window and refresh the parent interface. There are two methods:A) Close the parent window when the child window is closed: opener. location. reload (); window. close (); B) Check the parent window. If the child window is closed, it is automatically refreshed after a specified period of time: <SCRIPT> var newwindow; var timer; function OpenWindow (URL) {newwindow = Window. open (URL, "", "width = 400, Height = 300, resizable = yes"); timer = setinterval ("updateafterclose ()", 1000);} function updateafterclose () {// The parent window checks whether the child window is closed and refresh itself, instead of refreshing the parent window if (newwindow. closed = true) {clearinterval (timer); self. location. reload (); // refresh return in the main window; }}</SCRIPT>4,Close the child window when the parent window is closed. This is how to check the onUnload of the parent window.Event:<SCRIPT> var newwindow; function OpenWindow (URL) {newwindow = Window. open (URL, "", "width = 400, Height = 300, resizable = yes");} function closechild () {newwindow. close () ;}</SCRIPT> Add the onUnload Event to the body: <body onUnload = "closechild ()">5,Close the parent window in the Child window. This function may be less useful:<SCRIPT> function closeparent () {opener. Close () ;}</SCRIPT> <input type = button value = "close parent window" onclick = closeparent ()>