hwg-techniques archives | Aug 2002 | new search | results | previous | next |
ASP page, closing a window with JavaScriptby "Craig" <cd-ml(at)aardvark.net.au> |
|
Hi, Can you close a window with JavaScript after the page changes (for lack of a better word)? I have the ASP page below (watch the word-wrap). It simply opens a new window when the 'open' button is clicked, and tries to close it with the 'close' button. The 'open' button is a submit type which submits the form. I've tried to simplify the page and remove anything that's not related. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <script language="javascript"> <!-- function UploadStatus() { var w = 480, h = 340; //if (document.all || document.layers) { w = screen.availWidth; h = screen.availHeight; //} var popW = 150, popH = 150; var leftPos = (w-popW)/2, topPos = (h-popH)/2; UploadStatus = window.open('page.htm','UploadWindow','scrollbars=no,status=no,width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos); } function CloseUpload() { UploadStatus.close(); } //--> </script> <%=request.form("open")%> <form action="test.asp" method="post"> <input type="submit" value="open" name="open" onclick="UploadStatus();"> <input type="button" value="close" onclick="CloseUpload();"> </form> </body> </html> Thanks, Craig.
HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA