Firefox related question

J

jackchang1

Hi

I should admit at the beginning that I love FireFox very much. But
recently there were two FF related issues that bothered me, and I had
no idea.

The first one is how to use javascript to close the FF window. I can
use window.close() to close the children window, but I can't close the
parent window. In IE, you can close parent window through
window.close() with a warning message. So I am wondering if there is a
setting in FF so that I can close the parent window using
window.close().

The second one is a little bit complicated. I have a couple of pages
and on each page there is a timer. At the beginning, everything is
normal and it works pretty well. After I submitted a form and get
response from server, there is a progress bar in the status bar of FF.
The duration of the progress bar depends on the delay of my timer. I
set it to be 1 second. So I will see a progress bar in each second.
It looks like the page is refreshing itself in each second.

Thanks!
 
R

Randy Webb

(e-mail address removed) said the following on 11/2/2006 5:58 PM:
Hi

I should admit at the beginning that I love FireFox very much. But
recently there were two FF related issues that bothered me, and I had
no idea.

The first one is how to use javascript to close the FF window.

You can't in 2.0. View the Error Console and it will explain it quite
simply by the message it gives:

"Scripts may not close windows that were not opened by script."

I can use window.close() to close the children window, but I can't close the
parent window. In IE, you can close parent window through
window.close() with a warning message.

<script type="text/javascript">
window.opener = "Anything You want";
window.close();
</script>

No warning in IE.
But opening a site to have it close your window is about as user
friendly as trying to steal there bank information.
So I am wondering if there is a setting in FF so that I can
close the parent window using window.close().

Fortunately, no.
The second one is a little bit complicated. I have a couple of pages
and on each page there is a timer. At the beginning, everything is
normal and it works pretty well. After I submitted a form and get
response from server, there is a progress bar in the status bar of FF.
The duration of the progress bar depends on the delay of my timer. I
set it to be 1 second. So I will see a progress bar in each second.
It looks like the page is refreshing itself in each second.

Don't use the status bar for things the status bar weren't meant to be
used for and you don't have that "issue". And FF has a setting so that
you can't fool with the status bar.
 
J

jackchang1

window.opener = "Anything You want";
window.close();
</script>

No warning in IE.
But opening a site to have it close your window is about as user
friendly as trying to steal there bank information.
Actually there is a warning message if you try to close the window that
is not opened by script in IE, and the window will be closed after you
confirm it. I guess the window will not be closed if I cancel it.
Fortunately, no.
Bummer! This is bad news for me! :(
Don't use the status bar for things the status bar weren't meant to be
used for and you don't have that "issue". And FF has a setting so that
you can't fool with the status bar.
I didn't mean to use that status bar. I am just wondering why there is
a progress bar in the status bar. I need to avoid that progress bar or
at least disable the status bar.

Thanks again for sharing your knowledge!
 
J

jackchang1

I didn't mean to use that status bar. I am just wondering why there is
a progress bar in the status bar. I need to avoid that progress bar or
at least disable the status bar.
In this issue, I have a timer, upon which I can get the time
information updated in one div on my page. I didn't rewrite the whole
page, just assign a new innerHTML for that div. Does this rewrite will
affect the progress bar?
 
R

Randy Webb

(e-mail address removed) said the following on 11/2/2006 6:34 PM:
Actually there is a warning message if you try to close the window that
is not opened by script in IE, and the window will be closed after you
confirm it. I guess the window will not be closed if I cancel it.

No, if you cancel it then the window won't close. The snippet I posted
worked - for a very long time - in IE and I honestly didn't test it in
my IE7 to see if it still worked but it doesn't - which is a good thing.
 

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

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top