need to close main window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kevin dalby

    #1

    need to close main window

    I use the script below to open a side panel on my desktop without all the
    buttons and menu items. IE 6
    It works well.
    What I'd like to add is add a line of code that will close the calling
    parent window (right now I make it visible by resizing it and clicking on a
    close link). I'll even settle for having to confirm the closure but, the
    ultimate would be that it would close by itself.

    KD

    =============== =============== ==
    <html>
    <title>MySideBa r</title>
    <body bgcolor="#FFFFF F" onLoad="OpenSid eBar()">
    <script language="JavaS cript">
    <!--
    // This function moves the window when the page is loaded
    // to the top left corner and resizes it then opens a side window panel
    // ideally I want it to close the calling browser window, even if asked to
    confirm
    //
    function OpenSideBar()
    {
    self.moveTo(0,0 )
    self.resizeTo(3 00,300)
    window.open("ht tp://www.google.ca", "MySideBar","wi dth=150,height= 965,left=0,
    top=0,location= no,menubar=no,r esizable=no,scr ollbars=yes,sta tus=no,toolbar= n
    o,fullscreen=no ")
    }
    function CloseWindow()
    {
    self.close()
    }
    -->
    </script>

    <div align="right">
    <table border="0">
    <tr>
    <td><a href=javascript :CloseWindow()> Close Window</a>
    </tr>
    </table>
    </div>
    </body>
    </html>






  • Randy Webb

    #2
    Re: need to close main window

    kevin dalby wrote:
    [color=blue]
    > I use the script below to open a side panel on my desktop without all the
    > buttons and menu items. IE 6
    > It works well.
    > What I'd like to add is add a line of code that will close the calling
    > parent window (right now I make it visible by resizing it and clicking on a
    > close link). I'll even settle for having to confirm the closure but, the
    > ultimate would be that it would close by itself.
    >
    > KD
    >
    > =============== =============== ==
    > <html>
    > <title>MySideBa r</title>
    > <body bgcolor="#FFFFF F" onLoad="OpenSid eBar()">
    > <script language="JavaS cript">
    > <!--
    > // This function moves the window when the page is loaded
    > // to the top left corner and resizes it then opens a side window panel
    > // ideally I want it to close the calling browser window, even if asked to
    > confirm
    > //
    > function OpenSideBar()
    > {
    > self.moveTo(0,0 )
    > self.resizeTo(3 00,300)
    > window.open("ht tp://www.google.ca", "MySideBar","wi dth=150,height= 965,left=0,
    > top=0,location= no,menubar=no,r esizable=no,scr ollbars=yes,sta tus=no,toolbar= n
    > o,fullscreen=no ")
    > }
    > function CloseWindow()
    > {
    > self.close()
    > }
    > -->
    > </script>
    >
    > <div align="right">
    > <table border="0">
    > <tr>
    > <td><a href=javascript :CloseWindow()> Close Window</a>
    > </tr>
    > </table>
    > </div>
    > </body>
    > </html>[/color]

    <script type="text/javascript">
    window.open("ht tp://www.google.ca", "MySideBar","pa rams_here")
    window.opener = window;
    window.close();
    </script>

    Is all you need.

    --
    Randy

    Comment

    • kevin dalby

      #3
      Re: need to close main window

      Thanks for the Tip - works like a dream.
      KD

      "Randy Webb" <hikksnotathome @aol.com> wrote in message
      news:HrudnXhjRr N-sJXd4p2dnA@comc ast.com...[color=blue]
      > kevin dalby wrote:
      >[color=green]
      > > I use the script below to open a side panel on my desktop without all[/color][/color]
      the[color=blue][color=green]
      > > buttons and menu items. IE 6
      > > It works well.
      > > What I'd like to add is add a line of code that will close the calling
      > > parent window (right now I make it visible by resizing it and clicking[/color][/color]
      on a[color=blue][color=green]
      > > close link). I'll even settle for having to confirm the closure but,[/color][/color]
      the[color=blue][color=green]
      > > ultimate would be that it would close by itself.
      > >
      > > KD
      > >
      > > =============== =============== ==
      > > <html>
      > > <title>MySideBa r</title>
      > > <body bgcolor="#FFFFF F" onLoad="OpenSid eBar()">
      > > <script language="JavaS cript">
      > > <!--
      > > // This function moves the window when the page is loaded
      > > // to the top left corner and resizes it then opens a side window panel
      > > // ideally I want it to close the calling browser window, even if asked[/color][/color]
      to[color=blue][color=green]
      > > confirm
      > > //
      > > function OpenSideBar()
      > > {
      > > self.moveTo(0,0 )
      > > self.resizeTo(3 00,300)
      > >[/color][/color]
      window.open("ht tp://www.google.ca", "MySideBar","wi dth=150,height= 965,left=0,[color=blue][color=green]
      > >[/color][/color]
      top=0,location= no,menubar=no,r esizable=no,scr ollbars=yes,sta tus=no,toolbar= n[color=blue][color=green]
      > > o,fullscreen=no ")
      > > }
      > > function CloseWindow()
      > > {
      > > self.close()
      > > }
      > > -->
      > > </script>
      > >
      > > <div align="right">
      > > <table border="0">
      > > <tr>
      > > <td><a href=javascript :CloseWindow()> Close Window</a>
      > > </tr>
      > > </table>
      > > </div>
      > > </body>
      > > </html>[/color]
      >
      > <script type="text/javascript">
      > window.open("ht tp://www.google.ca", "MySideBar","pa rams_here")
      > window.opener = window;
      > window.close();
      > </script>
      >
      > Is all you need.
      >
      > --
      > Randy
      >[/color]


      Comment

      Working...