javascript 父窗口打开子窗口
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13702808/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
parent window open child window
提问by muhdazmilug
I want a page that open child window. The child window will be redirect to other website for processing. The other website will send the result to our server by redirect on the child window.our server will process the result and return to parent window and close the child window. Can it be done and how?
我想要一个打开子窗口的页面。子窗口将被重定向到其他网站进行处理。另一个网站将通过重定向子窗口将结果发送到我们的服务器。我们的服务器将处理结果并返回到父窗口并关闭子窗口。可以做到吗?如何做到?
回答by MD Sayem Ahmed
- You use window.openmethod to open a child window and store the returned reference to interact with it later.
- You use the window.parentproperty from the child window to access the parent window.
- 您使用window.open方法打开一个子窗口并存储返回的引用以供以后与其交互。
- 您可以使用子窗口中的window.parent属性来访问父窗口。
Hereis an article demonstrating the approach.
这是一篇演示该方法的文章。