473,378 Members | 1,609 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,378 software developers and data experts.

FireFox Closes Window Before Opener Function Executes

The following javascript appears on a popup window.

<script language="javascript" type="text/javascript">
function InsertContact(value)
{
window.opener.CallBackContact(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 2482
Lee
ba*********@gmail.com said:
>
The following javascript appears on a popup window.

<script language="javascript" type="text/javascript">
function InsertContact(value)
{
window.opener.CallBackContact(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*********@gmail.com said:

The following javascript appears on a popup window.

<script language="javascript" type="text/javascript">
function InsertContact(value)
{
window.opener.CallBackContact(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...@gmail.com said:
>The following javascript appears on a popup window.
><script language="javascript" type="text/javascript">
function InsertContact(value)
{
window.opener.CallBackContact(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...@gmail.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...@gmail.com said:
The following javascript appears on a popup window.
<script language="javascript" type="text/javascript">
function InsertContact(value)
{
window.opener.CallBackContact(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
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"...
2
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...
5
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...
4
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...
1
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. ...
22
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...
29
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.