PDA

View Full Version : close window


nas-t1
12-08-2006, 03:04 PM
I try to make make "close window" button or link and I used this codes:



<form>
<input type="button" value="Close Window" onClick="window.close()">
</form>



or this one


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



None of this one works in firefox. Do I have to do some modification to the code? Does someone have other code I can use?

Jon Hanlon
12-10-2006, 06:23 PM
They are both legit.
IE gives a warning if you try to close a window not opened by script, but FF flat out refuses to do it.
Can you open the window by script? use window.open()