Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Dec 2009
    Posts
    173
    Thanks
    24
    Thanked 1 Time in 1 Post

    Jquery - How to run script after window.open loads?

    How can i run a script after the window.open loads completely?

  • #2
    Regular Coder Amphiluke's Avatar
    Join Date
    Jul 2009
    Posts
    312
    Thanks
    3
    Thanked 89 Times in 89 Posts
    The window.open() method returns a reference to a window object. You may use it to add a "load" event handler.
    Code:
    var wnd = window.open("url.html", "", "");
    wnd.onload = function() { alert("complete"); };
    I am still learning English

  • #3
    Regular Coder
    Join Date
    Dec 2009
    Posts
    173
    Thanks
    24
    Thanked 1 Time in 1 Post
    Can i make a statement with that?

    like

    Code:
    if (win.onload == true){
    
    }

  • #4
    Regular Coder Amphiluke's Avatar
    Join Date
    Jul 2009
    Posts
    312
    Thanks
    3
    Thanked 89 Times in 89 Posts
    Code:
    var wnd = window.open("url.html", "", "");
    wnd.onload = function() { wnd.wndLoaded = true; };
    // ...
    if (wnd.wndLoaded === true) {
      // ...
    }
    ?
    I am still learning English

  • #5
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    since you asked about jquery specifically : http://docs.jquery.com/Tutorials:Introducing_$(document).ready()


  •  

    Posting Permissions

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