In the django function showRelatedObjectLookupPopup, I'd like to bind a function to a button in the newly popped up window, but I don't know how to refer to the new window. Here is what I have tried:
function showRelatedObjectLookupPopup(triggeringLink) {
// other function stuff omitted
var name = triggeringLink.id.replace(/^lookup_/, '');
name = id_to_windowname(name);
var win = window.open(href, name, 500, 700, resizable=yes, scrollbars=yes');
win.onload = function () {
$(document).ready(function() {
$("input.default").hover(function () {alert('hovered')})})};
win.focus();
return false;
}
But this binds to the button in the original window.