Named window handle

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Simon Wigzell

    #1

    Named window handle

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

    function poplink(filenam e)
    {
    filestring = filename + "htm"
    LinkWindow = window.open(fil estring,'LinkWi ndow','');
    }

    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(filenam e)
    {
    filestring = filename + "htm"
    LinkWindow[LinkWindowCount] = window.open(fil estring,'LinkWi ndow','');
    if (LinkWindowCoun t < 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!


  • Lasse Reichstein Nielsen

    #2
    Re: Named window handle

    "Simon Wigzell" <simonwigzell@s haw.ca> writes:
    [color=blue]
    > LinkWindow = window.open(fil estring,'LinkWi ndow','');[/color]
    [color=blue]
    > I'd be happy if I could create a new window handle each time so that all my
    > popup windows will be unique.[/color]

    Change 'LinkWindow' to '_blank'.

    /L
    --
    Lasse Reichstein Nielsen - lrn@hotpop.com
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    • Simon Wigzell

      #3
      Re: Named window handle


      "Lasse Reichstein Nielsen" <lrn@hotpop.com > wrote in message
      news:isf1bn0a.f sf@hotpop.com.. .[color=blue]
      > "Simon Wigzell" <simonwigzell@s haw.ca> writes:
      >[color=green]
      > > LinkWindow = window.open(fil estring,'LinkWi ndow','');[/color]
      >[color=green]
      > > I'd be happy if I could create a new window handle each time so that all[/color][/color]
      my[color=blue][color=green]
      > > popup windows will be unique.[/color]
      >
      > Change 'LinkWindow' to '_blank'.
      >
      > /L
      > --
      > Lasse Reichstein Nielsen - lrn@hotpop.com
      > DHTML Death Colors:[/color]
      <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>[color=blue]
      > 'Faith without judgement merely degrades the spirit divine.'[/color]

      Doh! Of course, thanks!


      Comment

      Working...