Waiting for child window loading to complete

This works if the location of the newly opened window is same-origin:

var w = window.open("https://stackoverflow.com/questions/1372022/child.html")
w.addEventListener('load', w.doSomething, true); 

Leave a Comment