I am opening a popup window with
var popup = window.open(\'...\', \'...\');
This javascript is defined in a control. This control is then
Ok so what you do is as follows.
create a method "setWindowObjectInParent" then call that in the popup. var popupwindow;
function setWindowObjectInParent(obj)
{
popupwindow = obj;
}
Now you have an object that you can call focus on.
So in the popup add
$(window).unload(function(){
window.opener.setWindowObjectInParent();
});
window.opener.setWindowObjectInParent(window);
This will unset the obj when the popup is closed and set the object when it is opened.
Thus you can check if your popup is defined and then call focus.