Loading ...
Sorry, an error occurred while loading the content.

[NH] previously spawned window

Expand Messages
  • Brett Taylor
    How do I check if a previously spawned window is still open? here is how I open the window... onopen= window.open( midisnip.html , midijukebox , toolbar=NO,
    Message 1 of 2 , Oct 7, 1999
    • 0 Attachment
      How do I check if a previously spawned window is still open?

      here is how I open the window...

      onopen="window.open('midisnip.html', 'midijukebox', 'toolbar=NO,
      location=NO, directories=NO, status=NO, menubar=no, scrollbars=NO,
      resizable=NO, copyhistory=yes, width=150 height=100')"

      Thats in my body tag... need to check if its still open before opening
      another one...

      God Bless,
      - Brett Taylor -

      -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
      weednix@... http://enkisoft.cjb.net/ icq: 8473626
      Request my: vCard, Geek Code, Business Card, Marital Status, Anything!
      -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    • Grant
      ... The window.closed property returns a boolean value true if closed false if open Is window closed
      Message 2 of 2 , Oct 8, 1999
      • 0 Attachment
        > How do I check if a previously spawned window is still open?
        >
        > here is how I open the window...
        >
        > onopen="window.open('midisnip.html', 'midijukebox', 'toolbar=NO,
        > location=NO, directories=NO, status=NO, menubar=no, scrollbars=NO,
        > resizable=NO, copyhistory=yes, width=150 height=100')"
        >
        > Thats in my body tag... need to check if its still open before opening
        > another one...

        The window.closed property returns a boolean value true if closed false if
        open

        <HTML>
        <HEAD>
        <TITLE>Is window closed</TITLE>
        <SCRIPT type="text/javascript" language="JavaScript">
        var win

        function openWin()
        {
        win = window.open("midisnip.html", "midijukebox",
        "width=150,height=100,toolbar=no,location=no,directories=no,status=no,menuba
        r=no,scrollbars=no,resizable=no,copyhistory=yes")
        win.focus()
        }

        function reFocus()
        {
        if(win.closed)
        {
        alert(win.closed)
        openWin()
        }
        else
        {
        alert(win.closed)
        win.focus()
        }
        }

        </SCRIPT>
        </HEAD>
        <BODY onload="openWin()">
        <A href="javascript:reFocus()">refocus</A>
        </BODY>
        </HTML>

        Hope this helps.

        By the way. your original script contains a missing comma
        "width=150 height=100"
        should be
        width=150,height=100
        Try your page in Netscape and the open window won't resize properly.
        Ie is more forgiving.
      Your message has been successfully submitted and would be delivered to recipients shortly.