CD-255Appendix F . Examples from Parts III and (Http web server)

CD-255Appendix F . Examples from Parts III and IV var newWind // set flag to help out with special handling for window closing var isIE3 = (navigator.appVersion.indexOf( MSIE 3 ) != -1) ? true : false // make the new window and put some stuff in it function newWindow() { newWind = window.open( , subwindow , HEIGHT=200,WIDTH=200 ) // take care of Navigator 2 if (newWind.opener == null) { newWind.opener = window } setTimeout( finishNewWindow() , 100) } function finishNewWindow() { var output = output +=

A Sub-window

output +=
newWind.document.write(output) newWind.document.close() } // close subwindow, including ugly workaround for IE3 function closeWindow() { if (isIE3) { // if window is already open, nothing appears to happen // but if not, the subwindow flashes momentarily (yech!) newWind = window.open( , subwindow , HEIGHT=200,WIDTH=200 ) } if (newWind && !newWind.closed) { newWind.close() } }

To complete the example of the window opening and closing, notice that the sub- window is given a button whose onClickevent handler closes the main window. In Navigator 2 and Internet Explorer 3, this occurs without complaint. But in NN3+ and IE4+, the user is presented with an alert asking to confirm the closure of the main browser window. windowObject.closed
Go visit our java server pages services for a reliable, lowcost webhost to satisfy all your needs.

Leave a Reply