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

remember all windows I opened

Hi everybody,

how can I remember all windows I opened to close them with one click on a
button? (btw: do arrays exist in Javascript?)
Harrry
Jul 20 '05 #1
5 1666
Harald Weiser wrote:
Hi everybody,

how can I remember all windows I opened to close them with one click on a
button? (btw: do arrays exist in Javascript?)
Harrry

Keep the references returned by window.open(). Yes, arrays exist. You
want to use an array for this, do you?

http://devedge.netscape.com/library/...j.html#1008453

--
Bas Cost Budde
http://www.heuveltop.org/BasCB
but the domain is nl

Jul 20 '05 #2
Harald Weiser wrote:
Hi everybody,

how can I remember all windows I opened to close them with one click on a
button? (btw: do arrays exist in Javascript?)
Harrry

var myArray = new Array();

myArray[0] = window;
myArray[1] = window.self;
myArray[2] = window.opener;
//etc

Of course, replace these windows with the windows you care about.

Brian

Jul 20 '05 #3

"Bas Cost Budde" <ba*@heuveltop.org> schrieb im Newsbeitrag
news:c0**********@news2.solcon.nl...
Keep the references returned by window.open(). Yes, arrays exist. You
want to use an array for this, do you?


Ok. Thats exactly what I am doing now. BUT if I reload my main window, the
array is reinstantiated and all prior values are gone :-(
Jul 20 '05 #4
Harald Weiser wrote:
Ok. Thats exactly what I am doing now. BUT if I reload my main window, the
array is reinstantiated and all prior values are gone :-(


Yes, that is what happens when you reload the main window. Web pages
are stateless, meaning they do not retain data on reloads. There is a
mechanisim which can fix that... they are called cookies.

If you want a reloaded page to have data from the previous page, you
need to either use a cookie, or encode it in the search field of the
URL, which is really messy. (something like yourpage.html?<your data here>

I suppose you could also have a master window or frame, which retains
the data you need... But that is messy too.

Come to think of it, having multpile windows open at the same time is
messy to begin with :)

Brian
Jul 20 '05 #5
Harald Weiser wrote:
"Bas Cost Budde" <ba*@heuveltop.org> schrieb im Newsbeitrag
news:c0**********@news2.solcon.nl...

Keep the references returned by window.open(). Yes, arrays exist. You
want to use an array for this, do you?

Ok. Thats exactly what I am doing now. BUT if I reload my main window, the
array is reinstantiated and all prior values are gone :-(


Wenn du eine Array verwendet, warum noch danach fragen?

But that aside. <body onunload="cleanup()"> and then close all child
windows from the cleanup function.

Too harsh? Some other approach that comes to mind is some 'anchor
construct', where children windows keep an eye on the parent and start a
relinking procedure when the content refreshes.

Does the array die as well if it sits in an external script?

--
Bas Cost Budde
http://www.heuveltop.org/BasCB
but the domain is nl

Jul 20 '05 #6

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

Similar topics

3
by: J.R | last post by:
I'm trying to determine if a named child window has been opened before opening a new one, however my challenge is that the child window may have been opened from a parent that no longer exists,...
0
by: Nonoy of Philippines | last post by:
Hello, guys... I'm just starting to develop web applications and I have this problem regarding Session objects At some parts of my application, I open modal dialog window which also opens...
0
by: Nonoy of Philippines | last post by:
I'm not sure if my 1st posting was actually posted. So, sorry if I duplicated it. For some reason, when there are previously opened IE windows before I opened the IE window that displays our...
4
by: Hal | last post by:
Can someone please tell me what is wrong with this script? <script language="JavaScript"> <!-- function HF_CloseAllChildren() { if (g_win1) != undefined { if ((g_win1) && !(g_win1.closed))...
1
by: Shannon Rotz | last post by:
I have a database split into front-end, back-end, on a machine running Windows XP professional (no network, just a single machine). I just upgraded the database from Access 97 to Access 2000. The...
0
by: Jim dunn | last post by:
HI I am having problems with C# with regards to its compatibility with win32 API methods, I am trying to read from a windows CE comm port using C# and imported methods from coredll.dll, it seems...
6
zybernau
by: zybernau | last post by:
hi, all in javascript i need to close all the child windows that i have opened through a parent window scenario: * here i will be having as many as child window opened and name given to...
18
zybernau
by: zybernau | last post by:
hi, here is my scenario i am having a array variable in javascript which contains data. while refreshing or postback these varibles got lost and i did'nt able to get those data in the variables...
7
by: Andrew Poulos | last post by:
Is there a way for javascript to know if a browser has been set to open new windows in tabs? I'm trying to fix some code that allows a user to close a window that javascript opened and it seems to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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
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?

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.