PDA

View Full Version : get window names


head8k
09-26-2002, 01:13 PM
Is there a way to get the names of all windows opened by javascript on a page? The names (in the window.open() call) are randomly generated (on the server side) and written into the HTML depending on my user's choices on a form on the previous page and are therefore not the same each time the page loads.

What I would like to do is get the window names in an array which will be populated onLoad of the page. Can anyone help?

chrismiceli
09-26-2002, 07:24 PM
to name a window you do this, i hope this helps

window.open("url", "name", "options")
options are like scrollbars=yes and stuff
tip, if you have more than one option ex. scrollbars=yes,toolbar=yes...
if you put spaces between the commas and the next option netscape doesn't work as well, so no spaces

A1ien51
09-26-2002, 07:25 PM
why don't you just have the server side put those random names into an array inside of a script that you can dynamically wirte. Then you will have the names

JSB
09-26-2002, 08:46 PM
But still, the popWin's names do not exist until the window exists.

I think that you should create the array on the fly as various pop windows are put to use instead of searching for windows that may not even exist. This way, the array only holds the windows that are in use.

Also, you may want to remove the window names from the array as the various windows are closed.

Just a thought.