Is there an easy way to set a \"callback\" function to a new window that is opened in javascript? I\'d like to run a function of the parent from the new window, but I want t
var newWindow = window.open(window.location.origin); newWindow.onload = function() { $(newWindow.document.body).addClass('new-window-body-class'); };