Link to home
Start Free TrialLog in
Avatar of portal123
portal123

asked on

window.close() do NOT work on FireFox..

I used the following code to close window. It works on I.E, but not FireFox. How can I resolve a problem??

<FORM>
<INPUT TYPE="button" VALUE="LogOut" onClick="window.close()">
</FORM>
Avatar of Cem Türk
Cem Türk
Flag of Türkiye image

its a security issue with FF you cant close a window except it is a pop-up window (that opened by window.open method)
SOLUTION
Avatar of Masoudgh
Masoudgh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JRevathi
JRevathi

I tried the above code.. it is not working for FF.........
window.close(); works for only pop-up windows..

Thanks
Bhanu Prakash
As far as I tested, easiest way to close window for most browsers (including ff2 & ff3, without need for changing browser conf.) is this:


<input type="button" name="Close" 
onclick="window.opener = window.self; window.close();" />

Open in new window