window.opener.focus(); cross domain problem in IE


  • Hi


    I have a problem i would like to solve.


    A visitor on is linked to with a simple "<a href "and target="_blank". When this visitor close the window the function below is called.


    <script language="javascript">
     window.onunload = function()


    This works great in FF. But it only works with IE when the new child and parents location is on the same domain. To set focus with IE and the code above. The closing window and the opener window must use the same domain like I cant get this to work if the opener window is on and the closing window is on


    I cannot set document.domain to make this work either cause of restrictions.


    How can i solve this problem?

    Thursday, May 15, 2008 11:35 AM

All replies


    I don't think you can get around this.  Its a rather draconian security measure that blocks cross domain abuses. 


    Try this in FF:-




    Does FF allow the opened to close the original page?




    Friday, May 16, 2008 8:00 PM