onUnload effect

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rich@NeedsHelp.com

    #1

    onUnload effect

    Is there any way to get the same effect that the body tag onUnload creates.

    I need a script that will be placed in the body of the html that will open a
    new window when the parent is closed.
    The window that will open is a survey for a webcast they just viewed.
    I can't put the script in the header or place a onUnload command in the body
    tag. Only place I can put it is in the
    body of the page within a script file.

    Thanks a bunch!
    Rich
  • Kimmo Laine

    #2
    Re: onUnload effect

    <Rich@NeedsHelp .com> kirjoitti viestissä:DI3we .3812$SQ1.3013@ fe09.lga...[color=blue]
    > Is there any way to get the same effect that the body tag onUnload
    > creates.
    >
    > I need a script that will be placed in the body of the html that will open
    > a
    > new window when the parent is closed.
    > The window that will open is a survey for a webcast they just viewed.
    > I can't put the script in the header or place a onUnload command in the
    > body
    > tag. Only place I can put it is in the
    > body of the page within a script file.
    >
    > Thanks a bunch!
    > Rich[/color]

    You can bind the onunload event to a function later in your code easily:

    <html>
    <head>
    </head>
    <body>
    <script>
    function foobar(){
    alert("foobar") ;
    }
    window.onunload = foobar;
    </script>
    </body>
    </html>

    Just replace foobar with what you need to open the survey.

    --
    "I am pro death penalty. That way people learn
    their lesson for the next time." -- Britney Spears

    eternal.erectio nN0@5P4Mgmail.c om


    Comment

    • Rich@NeedsHelp.com

      #3
      Re: onUnload effect

      Worked like a charm. Thanks alot.

      Comment

      Working...