how to close a window in FireFox?

J

Jake Barnes

I've a button that onclick calls a function that calls the following
code. The last 3 lines are for IE, which didn't want to close till I
put in the funny line with opener.

window.parent.focus();
window.close();
window.opener = window;
window.close();
window.parent.focus();

This closes a window in IE, but in FireFox an odd thing happens. I have
to mouseout of something before it closes. If I click the button and
then leave the mouse sitting there, above the button, then nothing
happens in FireFox. It's as if the code is broken.

I did originally have window.blur in their, instead of parent.focus.
But I took it out a while ago and did shift-refresh in FireFox.
 
A

ASM

Jake Barnes a écrit :
I've a button that onclick calls a function that calls the following
code. The last 3 lines are for IE, which didn't want to close till I
put in the funny line with opener.

window.parent.focus();
window.top.focus();

window.close();

that can't work if the window hasn't opened by javascript
window.opener = window;

old code to try to mystify browser
window.close();

and that yet works with FireFox ?
window.parent.focus();

This closes a window in IE, but in FireFox an odd thing happens. I have
to mouseout of something before it closes.

If I click the button and
then leave the mouse sitting there, above the button, then nothing
happens in FireFox. It's as if the code is broken.

Perhaps is it not too much happy ?
"I'll close myself while it is absolutely forbidden :-( "
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,234
Latest member
SkyeWeems

Latest Threads

Top