Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Handling Child Javascript Window Close events

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 4.43k
    Comment on it

    More often than not you want to create a child window and want to capture its events. This example simply captures its close event.

    var childWindow = window.open("new.html");
    
        function doStuffOnUnload() {
            alert("Child Windows Closed!");
        }
    
        if (typeof childWindow.attachEvent != "undefined") {
            childWindow.attachEvent("onunload", doStuffOnUnload);
        } else if (typeof childWindow.addEventListener != "undefined") {
            childWindow.addEventListener("unload", doStuffOnUnload, false);
        }
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: