window.opener alternatives

前端 未结 5 1851
生来不讨喜
生来不讨喜 2020-11-30 03:39

I am opening a modal popup window. Then I access a parent window textbox and other attributes using window.opener. It is working fine in firefox but not in IE8.

5条回答
  •  孤街浪徒
    2020-11-30 04:12

    You can pass arguments to showModalDialog function. Simply pass window object as an argument.

    window.showModalDialog(theURL, window);
    

    Yo can access the arguments from the modal window using dialogArguments. See: http://msdn.microsoft.com/en-us/library/ms533723%28VS.85%29.aspx

    var openerWindow = window.dialogArguments;
    

提交回复
热议问题