|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have opened a new window with the following link:
<A HREF="page2.htm" TARGET="new">Page 2</A> How can I place a button on the new page which will close the new window? Thanks. |
|
#2
|
|||
|
|||
|
In page2.html:
<INPUT type=button value="Close" onClick="self.close();" > |
|
#3
|
|||
|
|||
|
URLThanks.
My problem was that page2.html contained a frameset, and the document containing my close button was in one of the frames. I was using onClick="close();", which worked not at all, but after reading your answer it's finally occurred to me to use onClick="parent.close();", which works perfectly. [This message has been edited by christine (edited 04-23-99).] |
|
#4
|
|||
|
|||
|
another solution in case you don't want to use a button to close it, but anything like a text link or an image:
<a href="javascript:window.close()">close me</a> just in case you wanted to know URL |
|
#5
|
|||
|
|||
|
Do any of you know how to close a window without having a pop-up window?
I have an html page that I would like to have close after clicking a link on that page and having a new window open. I was thinking that I might be able to put a <base href="" name=""> and have the javascript be like <input onclick="NewWin.close("name of window");" type="button" value="Close New Window"> This doesn't seem to work, however. Do any of you know how to get this to work? |
|
#6
|
|||
|
|||
|
I think you'd have to do that via a JavaScript. Let me see if i can get something together later on... busy right now
![]() |
|
#7
|
|||
|
|||
|
kprag, there are a number of ways you can close a window when opening another, but there is one gotcha (at the end):
1. in the window to be closed: <body onblur="window.close()" 2. in the page that loads into the new window: <body onload="opener.close()"> plus, depending on how you open the new window, you can use variations on the close() method (like "self.close()") in the link that triggers the event. The gotcha is that if you try to close a window that was not opened by through a window.open() (in other words, the first window that opens when the browser launches or any window opened with the File > New menu command) will pop up a little security alert box asking for confirmation on closing the original window. Cheers, Bob |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > close button |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|