Close page after it loads?

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

    Close page after it loads?

    Is it possible to close a page using Javascript that will close *after* the
    page is loaded (it's an ASP page that performs an action).


  • Christopher Benson-Manica

    #2
    Re: Close page after it loads?

    Steve <steve@hello.co m> wrote:
    [color=blue]
    > Is it possible to close a page using Javascript that will close *after* the
    > page is loaded (it's an ASP page that performs an action).[/color]

    <html>
    <head>
    <script>
    function ready() {
    window.close();
    }
    </script></head>
    <body onload="ready() ;">
    </body></html>

    ? Insert whatever actions you need to perform before window.close().

    --
    Christopher Benson-Manica | I *should* know what I'm talking about - if I
    ataru(at)cybers pace.org | don't, I need to know. Flames welcome.

    Comment

    • Randy Webb

      #3
      Re: Close page after it loads?

      Christopher Benson-Manica said the following on 9/16/2005 12:04 PM:
      [color=blue]
      > Steve <steve@hello.co m> wrote:
      >
      >[color=green]
      >>Is it possible to close a page using Javascript that will close *after* the
      >>page is loaded (it's an ASP page that performs an action).[/color]
      >
      >
      > <html>
      > <head>
      > <script>
      > function ready() {
      > window.close();
      > }
      > </script></head>
      > <body onload="ready() ;">
      > </body></html>
      >
      > ? Insert whatever actions you need to perform before window.close().[/color]

      "Script is attempting to close the page......."

      And yes, I can make IE close a window that script didn't open. The
      Unconditional Truth will set you free if you search the archives for it.

      --
      Randy
      comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly

      Comment

      • Christopher Benson-Manica

        #4
        Re: Close page after it loads?

        Randy Webb <HikksNotAtHome @aol.com> wrote:
        [color=blue]
        > And yes, I can make IE close a window that script didn't open. The
        > Unconditional Truth will set you free if you search the archives for it.[/color]

        Hm, I see, although it seems that defeating protection offered by the
        browser should be done with care.

        --
        Christopher Benson-Manica | I *should* know what I'm talking about - if I
        ataru(at)cybers pace.org | don't, I need to know. Flames welcome.

        Comment

        • Randy Webb

          #5
          Re: Close page after it loads?

          Christopher Benson-Manica said the following on 9/16/2005 1:22 PM:[color=blue]
          > Randy Webb <HikksNotAtHome @aol.com> wrote:
          >
          >[color=green]
          >>And yes, I can make IE close a window that script didn't open. The
          >>Uncondition al Truth will set you free if you search the archives for it.[/color]
          >
          >
          > Hm, I see, although it seems that defeating protection offered by the
          > browser should be done with care.[/color]

          Whether that protection is offered by the browser is debatable though.
          Mozilla based browsers do not allow it, in any form. Other browsers do,
          and IE does it back to at least IE5.0/Win so it's hard to claim it as a
          bug, and if it's not a bug then it's an undocumented feature. And IE is
          not the only browser that does it.

          So, if a browser intentionally allows you to do it, then how is that
          browser safeguarding against it?

          --
          Randy
          comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly

          Comment

          • David Dorward

            #6
            Re: Close page after it loads?

            Steve wrote:
            [color=blue]
            > Is it possible to close a page using Javascript that will close *after*
            > the page is loaded (it's an ASP page that performs an action).[/color]

            Why not have the ASP page return a 204 response instead?


            --
            David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
            Home is where the ~/.bashrc is

            Comment

            Working...