473,405 Members | 2,444 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,405 software developers and data experts.

Monitoring status of another browser window

Hi

IE6 Win2k

The javascript FAQ describes how you can retain a reference to a window that
you have opened and manipulate the window - focus on it or close it, viz:

4.10 How do I check to see if a childwindow is open, before opening another?
var myWin=null;
function openWin(aURL) {
if (!myWin || myWin.closed ) {
myWin=window.open(aURL,'myWin');
} else{
myWin.location=aURL;
myWin.focus();
}
}

However, javascript variables appear to be reinitialised each time the
browser window
is refreshed so the mechanism described by the FAQ seems to be defeated if
the user refreshes the page.

a) Is it true that javascript variables are reinitiliised when the page is
refreshed?
b) If a) then is there some other way to monitor a child window from another
browser window despite user refreshes?

Thanks
Mike May

Jul 20 '05 #1
2 1800
Mike May wrote:
Hi

IE6 Win2k

The javascript FAQ describes how you can retain a reference to a window that
you have opened and manipulate the window - focus on it or close it, viz:

4.10 How do I check to see if a childwindow is open, before opening another?
var myWin=null;
function openWin(aURL) {
if (!myWin || myWin.closed ) {
myWin=window.open(aURL,'myWin');
} else{
myWin.location=aURL;
myWin.focus();
}
}

However, javascript variables appear to be reinitialised each time the
browser window
is refreshed so the mechanism described by the FAQ seems to be defeated if
the user refreshes the page.
Yep :)
a) Is it true that javascript variables are reinitiliised when the page is
refreshed?
Tis indeed the truth. Easy to test to.

alert(b)
b = "ok, it has a value now"
alert(b)
and then refresh the page......
b) If a) then is there some other way to monitor a child window from another
browser window despite user refreshes?


Use a cookie or sessions.

--
Randy

Jul 20 '05 #2
"Mike May" <ma*@dial.pipex.com> writes:
Hi

IE6 Win2k

The javascript FAQ describes how you can retain a reference to a window that
you have opened and manipulate the window - focus on it or close it, viz:

4.10 How do I check to see if a childwindow is open, before opening another?
var myWin=null;
function openWin(aURL) {
if (!myWin || myWin.closed ) {
myWin=window.open(aURL,'myWin');
} else{
myWin.location=aURL;
myWin.focus();
}
}

However, javascript variables appear to be reinitialised each time the
browser window
is refreshed so the mechanism described by the FAQ seems to be defeated if
the user refreshes the page.

a) Is it true that javascript variables are reinitiliised when the page is
refreshed?
Yes. There is no differene between
b) If a) then is there some other way to monitor a child window from another
browser window despite user refreshes?


Only very trickily.

If you try to open a window again with the same name, and it already
exists, you will be given a new reference to the window. It will probably
also change the content of the window.

If you control the content of the opened window, you can have it keep
check of its parent and write its own reference back to it. That is hard
to time correctly though.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #3

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

Similar topics

0
by: Sven Dzepina | last post by:
Hi All, how I can make a simply HostWatch - system which use a mysql DB and send me an e-Mail if the Server goes off and again on? I began to programm this last night, but the MySQL inquiry is...
3
by: JSheble | last post by:
I have a windows service that in the OnStart it creates a thread and runs a loop forever and ever, assuming the service is running. The loop stops during the OnStop event, and everything works...
3
by: Elizabeth Harmon | last post by:
hi All, I dont know if this is possible, so i am asking Is there a Way to monitor a connection when it is fetching on a web page? I am providing a status Bar and process to my users so they...
42
by: Greg | last post by:
Hi, I've designed a bookmark in Ajax / PHP that I will put soon on sourceforge.net. But I've got an very tricky bug. I try it on some computers with Internet Explorer/Windows, Firefox...
9
by: Simon Wigzell | last post by:
I have a little asp progress bar window that I open up with javascript, sized and located, all the extras turned off. It works by refreshing itself every second and displaying how much a file...
19
by: Frances | last post by:
Firefox is not respecting window.status, examples in this pg http://www.csua.berkeley.edu/~jgwang/jsform02.htm are ignored by Firefox.. why is this.. is there a solution.. thank you.. Frances
11
by: The Numerator | last post by:
How do you modify the status bar? (The status bar is the bar on the bottom in IE. It should read "Done" now.) I'm pretty sure, this requires JavaScript. Thanks.
3
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - I have window.status="Moomin"; why doesn't the statusbar change?...
18
by: mistral | last post by:
Is there some other (more advanced) effects for status bar, other than standard Scroller Bar, TypeWriter Scroller, Flashing Bar, Decrypter, Ticker, World Clock?
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?
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
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...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.