473,748 Members | 11,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FireFox Closes Window Before Opener Function Executes

The following javascript appears on a popup window.

<script language="javas cript" type="text/javascript">
function InsertContact(v alue)
{
window.opener.C allBackContact( value);
window.close();
}
</script>

I'm trying to tell the opener page to execute a function to refresh a
dropdown and then close the window. Unfortunatly this doesn't work in
FireFox. The window appears to close before it tells the opener to
execute it's function. If I comment out the window.close() Firefox will
execute the function and refresh the dropdown. Wrapping the
window.close in a setTimeout works but is not an option for my solution.

Jan 22 '07 #1
4 2511
Lee
ba*********@gma il.com said:
>
The following javascript appears on a popup window.

<script language="javas cript" type="text/javascript">
function InsertContact(v alue)
{
window.opener.C allBackContact( value);
window.close();
}
</script>

I'm trying to tell the opener page to execute a function to refresh a
dropdown and then close the window. Unfortunatly this doesn't work in
FireFox. The window appears to close before it tells the opener to
execute it's function. If I comment out the window.close() Firefox will
execute the function and refresh the dropdown. Wrapping the
window.close in a setTimeout works but is not an option for my solution.
Change your code so CallBackContact () closes the window.
Get rid of the "language" attribute while you're at it.
--

Jan 22 '07 #2

Lee wrote:
ba*********@gma il.com said:

The following javascript appears on a popup window.

<script language="javas cript" type="text/javascript">
function InsertContact(v alue)
{
window.opener.C allBackContact( value);
window.close();
}
</script>

I'm trying to tell the opener page to execute a function to refresh a
dropdown and then close the window. Unfortunatly this doesn't work in
FireFox. The window appears to close before it tells the opener to
execute it's function. If I comment out the window.close() Firefox will
execute the function and refresh the dropdown. Wrapping the
window.close in a setTimeout works but is not an option for my solution.

Change your code so CallBackContact () closes the window.
Or use setTimeout so it closes itself say 10ms later.

--
Rob

Jan 22 '07 #3
Using setTimeout is inconsistent. If I set 100 milliseconds for the
setTimeout and access my pages over an internal network the 100ms is
enough time to process the opener page reload and then close the popup.
If I access the same pages remotely over a cable broadband connection
the 100ms isn't enough time and I need to increase it further to 200ms.
I don't like the setTimeout solution because it is too variable on the
connection and involves guess work on when the parent page will finish
processing.

Lee, I will try out your solution.

On Jan 22, 6:18 pm, "RobG" <r...@iinet.net .auwrote:
Lee wrote:
badaczew...@gma il.com said:
>The following javascript appears on a popup window.
><script language="javas cript" type="text/javascript">
function InsertContact(v alue)
{
window.opener.C allBackContact( value);
window.close();
}
></script>
>I'm trying to tell the opener page to execute a function to refresh a
>dropdown and then close the window. Unfortunatly this doesn't work in
>FireFox. The window appears to close before it tells the opener to
>execute it's function. If I comment out the window.close() Firefox will
>execute the function and refresh the dropdown. Wrapping the
>window.close in a setTimeout works but is not an option for my solution.
Change your code so CallBackContact () closes the window.Or use setTimeout so it closes itself say 10ms later.

--
Rob- Hide quoted text -- Show quoted text -
Jan 25 '07 #4

Naa,

Even placing the window.close() on the opener page in the method I'm
targeting from the popup doesn't work. Its like the window.close()
steals focus or something and cancels out the operation of the code
before it. By the way, this problem is only occuring in FireFox.

On Jan 25, 9:58 am, badaczew...@gma il.com wrote:
Using setTimeout is inconsistent. If I set 100 milliseconds for the
setTimeout and access my pages over an internal network the 100ms is
enough time to process the opener page reload and then close the popup.
If I access the same pages remotely over a cable broadband connection
the 100ms isn't enough time and I need to increase it further to 200ms.
I don't like the setTimeout solution because it is too variable on the
connection and involves guess work on when the parent page will finish
processing.

Lee, I will try out your solution.

On Jan 22, 6:18 pm, "RobG" <r...@iinet.net .auwrote:
Lee wrote:
badaczew...@gma il.com said:
The following javascript appears on a popup window.
<script language="javas cript" type="text/javascript">
function InsertContact(v alue)
{
window.opener.C allBackContact( value);
window.close();
}
</script>
I'm trying to tell the opener page to execute a function to refresh a
dropdown and then close the window. Unfortunatly this doesn't work in
FireFox. The window appears to close before it tells the opener to
execute it's function. If I comment out the window.close() Firefox will
execute the function and refresh the dropdown. Wrapping the
window.close in a setTimeout works but is not an option for my solution.
Change your code so CallBackContact () closes the window.Or use setTimeout so it closes itself say 10ms later.
--
Rob- Hide quoted text -- Show quoted text -- Hide quoted text -- Show quoted text -
Jan 25 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
16034
by: fogwolf | last post by:
First a basic outline of what I am trying to do: I want to have a page spawn a pop-up when you click "submit" on its form. On this pop-up page there will be another form. When you click "submit" on the pop-up's form I want the pop-up to close & a new page to load in the "parent" window/page. I have this working in IE but cannot get it to work in Firefox. The parent window correctly loads the new page after submitting from the pop-up,...
2
18414
by: Stefan Sch?rmeli | last post by:
I already read about several problems using firefox and the window.opener property. But obviously it didn't help out. So here is my problem: I got a "Search..." link which opens a new window with an FTP-browser. function popup(url,width,height){ var popupX = (screen.width/2)-(width/2); var popupY = (screen.height/2)-(height/2); var pos = "left="+popupX+",top="+popupY;
5
3110
by: Rabia | last post by:
I am using the window.open() with modal=yes to simulate the pop up window as modalDialog in mozilla/firefox. The pop-up window (child) has a few options which the user selects and then click the submit button. What i need to do on this submit button click is to return the value from the child to the parent window, close the child window and reload the parent page to reflect the changes as selected in the child window. Can anybody...
4
5130
by: tcole6 | last post by:
My problem appears to be Firefox specific. I have a hyperlink that loads a new window. This window contains hyperlinks that call javascript functions in the parent window and then closes the child window. The function that is called contains an XMLHttpRequest. My problem is that everything happens as it should, the innerHTML is changed by the results of the XMLHttpRequest and the child window closes. The problem is this, in Firefox,...
1
6889
by: Jake Barnes | last post by:
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();
22
2794
by: giordan | last post by:
Hi all! I've wrote this code: <script type="text/javascript"> var largImg; var altImg; var txtTop = '<b>Ottima scelta!</b> Ora compila il form e premi "Ricevi banner". Il codice HTML ti verrà mostrato in questa pagina e, per comodità, ti verrà inviato, via mail, all\'indirizzo da te fornito. Se invece vuoi cambiare il banner premi "Seleziona banner"'; var txtButton = 'Cambia banner'; var testo = '';
29
3908
Frinavale
by: Frinavale | last post by:
I have 2 FireFox (version 2) browser windows opened. One is the child of the other. When the user is finished with the child window, a method in the parent window is called to refresh a section of the page. This is the JavaScript code that I'm using to refresh the content in the parent page: <script type="text/javascript"> function UpdateList() {
0
8989
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9537
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9367
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9319
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9243
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4599
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2213
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.