PDA

View Full Version : Help with window!!!



Sedrik
06-14-2005, 09:17 AM
Dear webmasters!
Hey! I need help.... Can you answer my question??? Have you got any script to close window on your webpage???
Please if you find any script, I will be happy! :)

cr3ative
06-14-2005, 09:41 AM
Sure, this should work:

<a href="javascript:window.close();">Close Window</a>

It will prompt if it is not in a parent-owned popup window.

cr3ative

jscheuer1
06-14-2005, 09:41 AM
Won't work in all situations because browsers are touchy about that sort of thing and constantly coming up with new ways to stop you but, here it is:
<script type="text/javascript">
window.opener=""
window.close();
</script>Of course this will simply close the window, how you use it is up to you. Things are much simpler if the window you are closing was opened as a named variable by javascript ex:
<script type="text/javascript">
var myWin=window.open('date.htm','dateWin')
setTimeout("myWin.close()",5000)
</script> This will open myWin and then close it after 5 seconds.

Sedrik
06-14-2005, 09:53 AM
Yes! Thank you! But can I close 1 window in 2 ??? :confused:
I want to allow 1 window in 2!

cr3ative
06-14-2005, 10:15 AM
You've lost me now - try re-explaining?

Thanks.
cr3ative

jscheuer1
06-15-2005, 09:41 AM
If you want to close two windows at once, you just have to do them one after the other in the code. If one of the windows you are closing is the one with the script, best to save it for last though, some browsers won't care.