469,929 Members | 1,766 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,929 developers. It's quick & easy.

Named window handle

I use a subroutine to popup windows in my sebsite. It looks like this :

function poplink(filename)
{
filestring = filename + "htm"
LinkWindow = window.open(filestring,'LinkWindow','');
}

Filename is just the extensionless web page name e.g. "Addresses"

Problem is of course every window popped up will replace the previously
popped up window and in the case of a popped up window popping up a window
the new window will just replace the calling window.

(Please, no lectures on popping up windows, I need to in my particular case
and here I'm just stripping it down to the bare problem for claritie and
simplicities s sake)

I'd be happy if I could create a new window handle each time so that all my
popup windows will be unique. If it could be the filename that would be fine
e.g. instead of the window handle variable being "LinkWindow" it would be
"Addresses". Is there some way of making the variable I assign the new
window to a variable? All I can come up with is somehow having LinkWindow an
array of window handles and just keep incrementing it e.g.

LinkWindow[100]; // 100 is more than enough windows for a typical session
LinkWindowCount = 0;

function poplink(filename)
{
filestring = filename + "htm"
LinkWindow[LinkWindowCount] = window.open(filestring,'LinkWindow','');
if (LinkWindowCount < 99)
LinkWindowCount++;
else
LinkWindowCount = 0;
}

What would be the correct syntax for creating LinkWindow as an array or is
there a better way of accomplishing the same thing?

Thanks!
Jul 23 '05 #1
2 1437
"Simon Wigzell" <si**********@shaw.ca> writes:
LinkWindow = window.open(filestring,'LinkWindow',''); I'd be happy if I could create a new window handle each time so that all my
popup windows will be unique.


Change 'LinkWindow' to '_blank'.

/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 23 '05 #2

"Lasse Reichstein Nielsen" <lr*@hotpop.com> wrote in message
news:is**********@hotpop.com...
"Simon Wigzell" <si**********@shaw.ca> writes:
LinkWindow = window.open(filestring,'LinkWindow','');
I'd be happy if I could create a new window handle each time so that all my popup windows will be unique.


Change 'LinkWindow' to '_blank'.

/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.'


Doh! Of course, thanks!
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Altramagnus | last post: by
4 posts views Thread by Brad Jones | last post: by
11 posts views Thread by objectref | last post: by
reply views Thread by Spiros | last post: by
3 posts views Thread by TC | last post: by
8 posts views Thread by Mészáros Tamás | last post: by
4 posts views Thread by alexandre.brisebois | last post: by
2 posts views Thread by Jonathan Boivin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.