473,395 Members | 1,584 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

how to close a window in FireFox?

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
1 6848
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: GEL | last post by:
Hi, I want to open a new browser window, let the user use that window for several minutes, and when they close, I'd like to change the page displayed in the original window. According to...
4
by: stevong | last post by:
It works on Konquerer though. I remember it works on IE too. I've tried window.close() too. Doesn't work on Firefox also. I've also tried to create a function. It doesnt work on Firefox also....
2
by: Buddha Pest | last post by:
The 1st window opens the 2nd window. The 2nd window opens the 3rd window. From the 3rd window, how do I close the 3rd and 2nd windows then change the URL of the 1st window? Thanks.
3
by: Sonnich | last post by:
Hi all! I have this in IE: <input type="button" class="box" value=" Close " onClick="window.close();"> but it does not work in FireFox. Can anyone tell me why
1
by: nebulus | last post by:
I'm working on a web app that under normal circumstances will be happy with the Session_OnEnd event, but when a user leaves a page by closing the browser by either Alt+F4 or just hitting the "X",...
37
by: Jan Tovgaard | last post by:
Hey everyone:) We have a critical problem, which I can see that other people also has ran into. In Internet Explorer 7 it is no longer possible to do a window.close after opening a window,...
7
by: Toccoa | last post by:
After considerable googling - I mean searching with Google(r) - I could not find javascript on a button or <a href=... to close a window in the latest versions of IE and FireFox. There seemed...
3
by: Laurahn | last post by:
The function javascript:window.close() is not working in firefox. how do i close browser window in firefox.
6
by: =?Utf-8?B?UGF1bA==?= | last post by:
I am looking for a java script to close a web form that I can attatch to a button click event. I am using vs2005, c#. Thanks -- Paul G Software engineer.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.