SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Guru Bullschmidt's Avatar
    Join Date
    Apr 2002
    Location
    USA
    Posts
    524
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How Trigger window.onblur?

    I have a little popup window I'm making.
    I'd like the window to just destroy itself if the user clicks on the original, calling page.

    This is what I tried in the header section of the popup page but the code is not being triggered:
    <script type="text/javascript"> <!--
    window.onblur = window.close();
    -->
    </script>

    And by the way I already tried this in the body tag:
    onblur="window.close()"

    And the body tag thing actually DID close the window if the user clicked on the original calling page. BUT the window also closed if the user clicked on a combo box on the popup (because the body lost the focus), and that was not good...

    Any ideas?
    J. Paul Schmidt
    www.Bullschmidt.com - Freelance Web and Database Developer
    www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips

  2. #2
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1. You're calling onblur twice - try not calling it for the body...

    2. Why not have an onfocus instead in the parent, and kill the child if it exists?


    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •