Please Help! - window.close() within frame

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

    Please Help! - window.close() within frame

    Hi, this is probably a very basic question but I'm not a javascript
    expert!
    Sure you get this asked often! Did some research but can't get it
    working.
    I'm thankful for any help!

    Thanks!

    Martin

    On my index page I have a frame like this:

    </HEAD>
    ....
    <FRAME name="main" SRC="login.aspx " APPLICATION="no ">
    ....
    <body>
    ....
    <p>This page uses frames, but your browser doesn't support them.</p>
    </body>

    On the content page (login.aspx) I've a HTML button with a onclick
    event for a javascript like this:

    <script language="javas cript">
    <!--
    // Function Close - Close Browser Window
    function fnclose() {
    parent.opener.c lose();
    }
    //-->
    </script>

    Question is, how do I close the window that actually contains the
    frame, I mean close the whole browser from login.aspx? How do I
    reference the parent window?
  • Martin Feuersteiner

    #2
    Re: Please Help! - window.close() within frame

    Mick,

    Thanks for your help! Unfortunately, it top.close() doesn't do the trick.
    Any other ideas?


    "Mick White" <mwhite13@BOGUS rochester.rr.co m> wrote in message
    news:qDaHc.3628 5$iJ4.26206@twi ster.nyroc.rr.c om...[color=blue]
    > Martin wrote:
    >[color=green]
    > > Hi, this is probably a very basic question but I'm not a javascript
    > > expert!
    > > Sure you get this asked often! Did some research but can't get it
    > > working.
    > > I'm thankful for any help!
    > >
    > > Thanks!
    > >
    > > Martin
    > >
    > > On my index page I have a frame like this:
    > >
    > > </HEAD>
    > > ...
    > > <FRAME name="main" SRC="login.aspx " APPLICATION="no ">
    > > ...
    > > <body>
    > > ...
    > > <p>This page uses frames, but your browser doesn't support them.</p>
    > > </body>
    > >
    > > On the content page (login.aspx) I've a HTML button with a onclick
    > > event for a javascript like this:
    > >
    > > <script language="javas cript">
    > > <!--
    > > // Function Close - Close Browser Window
    > > function fnclose() {
    > > parent.opener.c lose();
    > > }
    > > //-->
    > > </script>[/color]
    >
    > top.close();
    >
    > Iffy proposition though, unless you spawned the window.
    > Mick
    >[color=green]
    > >
    > > Question is, how do I close the window that actually contains the
    > > frame, I mean close the whole browser from login.aspx? How do I
    > > reference the parent window?[/color][/color]


    Comment

    • Mick White

      #3
      Re: Please Help! - window.close() within frame

      Martin Feuersteiner wrote:
      [color=blue]
      > Mick,
      >
      > Thanks for your help! Unfortunately, it top.close() doesn't do the trick.
      > Any other ideas?[/color]


      Something's wrong with your coding then.(URL?)

      Note that you cannot reliably close a window that you did not create.
      Mick
      [color=blue]
      >
      >
      > "Mick White" <mwhite13@BOGUS rochester.rr.co m> wrote in message
      > news:qDaHc.3628 5$iJ4.26206@twi ster.nyroc.rr.c om...
      >[color=green]
      >>Martin wrote:
      >>
      >>[color=darkred]
      >>>Hi, this is probably a very basic question but I'm not a javascript
      >>>expert!
      >>>Sure you get this asked often! Did some research but can't get it
      >>>working.
      >>>I'm thankful for any help!
      >>>
      >>>Thanks!
      >>>
      >>>Martin
      >>>
      >>>On my index page I have a frame like this:
      >>>
      >>></HEAD>
      >>>...
      >>><FRAME name="main" SRC="login.aspx " APPLICATION="no ">
      >>>...
      >>><body>
      >>>...
      >>><p>This page uses frames, but your browser doesn't support them.</p>
      >>></body>
      >>>
      >>>On the content page (login.aspx) I've a HTML button with a onclick
      >>>event for a javascript like this:
      >>>
      >>><script language="javas cript">
      >>><!--
      >>>// Function Close - Close Browser Window
      >>>function fnclose() {
      >>>parent.opene r.close();
      >>>}
      >>>//-->
      >>></script>[/color]
      >>
      >>top.close() ;
      >>
      >>Iffy proposition though, unless you spawned the window.
      >>Mick
      >>
      >>[color=darkred]
      >>>Question is, how do I close the window that actually contains the
      >>>frame, I mean close the whole browser from login.aspx? How do I
      >>>reference the parent window?[/color][/color]
      >
      >
      >[/color]

      Comment

      • Mick White

        #4
        Re: Please Help! - window.close() within frame

        Martin wrote:
        [color=blue]
        > Hi, this is probably a very basic question but I'm not a javascript
        > expert!
        > Sure you get this asked often! Did some research but can't get it
        > working.
        > I'm thankful for any help!
        >
        > Thanks!
        >
        > Martin
        >
        > On my index page I have a frame like this:
        >
        > </HEAD>
        > ...
        > <FRAME name="main" SRC="login.aspx " APPLICATION="no ">
        > ...
        > <body>
        > ...
        > <p>This page uses frames, but your browser doesn't support them.</p>
        > </body>
        >
        > On the content page (login.aspx) I've a HTML button with a onclick
        > event for a javascript like this:
        >
        > <script language="javas cript">
        > <!--
        > // Function Close - Close Browser Window
        > function fnclose() {
        > parent.opener.c lose();
        > }
        > //-->
        > </script>[/color]

        top.close();

        Iffy proposition though, unless you spawned the window.
        Mick
        [color=blue]
        >
        > Question is, how do I close the window that actually contains the
        > frame, I mean close the whole browser from login.aspx? How do I
        > reference the parent window?[/color]

        Comment

        Working...