By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,568 Members | 1,194 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,568 IT Pros & Developers. It's quick & easy.

how to close a window in FireFox?

P: n/a
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.

Sep 12 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/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.
<button onclick="mycode(); this.blur();">
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 :-( "
--
Stephane Moriaux et son [moins] vieux Mac
Sep 12 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.