I need to open a popup Window to a cross domain content. I should not allow the user either to access or close the parent window, till i am done with Child window.
我需要打开一个跨域内容的弹出窗口。我不应该允许用户访问或关闭父窗口,直到我完成子窗口。
The main issue with Modal window is that stops any asynchrnous process running on the main window. For example, timers and auto refresh wont be working in the parent window.
Modal窗口的主要问题是停止在主窗口上运行的任何异步进程。例如,定时器和自动刷新将不在父窗口中工作。
Is there any perfect way to do the above said.
有没有完美的方法来做上述说法。
Thanks in advance
提前致谢
6 个解决方案
#1
2
How about instead of popping up an actual window, you just open a pseudo-window...that is a div with some borders, make it draggable if you want, and place a large semi-transparent div that covers the rest of the page and blocks it from being clicked on. Basically do something like how Lightbox works
怎么样而不是弹出一个实际的窗口,你只需打开一个伪窗口...这是一个带有边框的div,如果你想要的话可以拖动它,并放置一个覆盖页面其余部分的大型半透明div并阻止它被点击。基本上做的事情就像Lightbox的工作方式
#2
1
You could use a fake window built via javascript. Several widget libraries have support for this. For example, see ExtJS, which also supports modal windows but it might be overkill for your application. For jQuery, browse through the plugins, like this one
您可以使用通过javascript构建的假窗口。几个小部件库都支持此功能。例如,请参阅ExtJS,它也支持模态窗口,但它可能对您的应用程序来说太过分了。对于jQuery,浏览插件,就像这样
#3
0
I think Telerik has a control for this if you are working on ASP.Net. Uses a div in its implementation as @Davr suggested. Modal windows are a bad option anyhow as they are not supported on all browsers.
如果您正在使用ASP.Net,我认为Telerik可以控制此问题。在@Davr建议的实现中使用div。模态窗口无论如何都是不好的选择,因为并非所有浏览器都支持它们。
#4
0
In addition to what Davr and thoriann said, you will likely need to make an Ajax call to grab the content. Since Ajax calls via the browser enforce the same-domain policy, you will need to make an Ajax call to your OWN server, which in-turn will need to make an xmlhttp sever-to-server request to grab the content the third-party server.
除了Davr和thoriann所说的,你可能还需要进行Ajax调用以获取内容。由于Ajax通过浏览器调用强制执行相同的域策略,因此您需要对您的OWN服务器进行Ajax调用,这反过来需要发出xmlhttp服务器到服务器请求以获取第三方的内容服务器。
#5
0
I feel the above answers wont fit for the following reasons..
我觉得上面的答案不适合以下原因..
JasonS Solution - The application is developed on J2EE technologies.
JasonS解决方案 - 该应用程序是基于J2EE技术开发的。
Other's solution - Some of the the URL Launched in the child window will communicate to the parent window through standard APIs. If i am using div or other in-built plug-in windows, then those javascript API will fail.
其他解决方案 - 子窗口中启动的某些URL将通过标准API与父窗口进行通信。如果我使用div或其他内置的插件窗口,那么这些JavaScript API将失败。
#6
0
Check out the Jquery plug in "BlockUI". When BlockUI is called the parent window is not accessable. You can do what you want on the modal then call "UnblockUI" to close the popup and give parent control again.
查看“BlockUI”中的Jquery插件。调用BlockUI时,父窗口不可访问。您可以在模态上执行所需操作,然后调用“UnblockUI”关闭弹出窗口并再次给出父控件。
Pete
#1
2
How about instead of popping up an actual window, you just open a pseudo-window...that is a div with some borders, make it draggable if you want, and place a large semi-transparent div that covers the rest of the page and blocks it from being clicked on. Basically do something like how Lightbox works
怎么样而不是弹出一个实际的窗口,你只需打开一个伪窗口...这是一个带有边框的div,如果你想要的话可以拖动它,并放置一个覆盖页面其余部分的大型半透明div并阻止它被点击。基本上做的事情就像Lightbox的工作方式
#2
1
You could use a fake window built via javascript. Several widget libraries have support for this. For example, see ExtJS, which also supports modal windows but it might be overkill for your application. For jQuery, browse through the plugins, like this one
您可以使用通过javascript构建的假窗口。几个小部件库都支持此功能。例如,请参阅ExtJS,它也支持模态窗口,但它可能对您的应用程序来说太过分了。对于jQuery,浏览插件,就像这样
#3
0
I think Telerik has a control for this if you are working on ASP.Net. Uses a div in its implementation as @Davr suggested. Modal windows are a bad option anyhow as they are not supported on all browsers.
如果您正在使用ASP.Net,我认为Telerik可以控制此问题。在@Davr建议的实现中使用div。模态窗口无论如何都是不好的选择,因为并非所有浏览器都支持它们。
#4
0
In addition to what Davr and thoriann said, you will likely need to make an Ajax call to grab the content. Since Ajax calls via the browser enforce the same-domain policy, you will need to make an Ajax call to your OWN server, which in-turn will need to make an xmlhttp sever-to-server request to grab the content the third-party server.
除了Davr和thoriann所说的,你可能还需要进行Ajax调用以获取内容。由于Ajax通过浏览器调用强制执行相同的域策略,因此您需要对您的OWN服务器进行Ajax调用,这反过来需要发出xmlhttp服务器到服务器请求以获取第三方的内容服务器。
#5
0
I feel the above answers wont fit for the following reasons..
我觉得上面的答案不适合以下原因..
JasonS Solution - The application is developed on J2EE technologies.
JasonS解决方案 - 该应用程序是基于J2EE技术开发的。
Other's solution - Some of the the URL Launched in the child window will communicate to the parent window through standard APIs. If i am using div or other in-built plug-in windows, then those javascript API will fail.
其他解决方案 - 子窗口中启动的某些URL将通过标准API与父窗口进行通信。如果我使用div或其他内置的插件窗口,那么这些JavaScript API将失败。
#6
0
Check out the Jquery plug in "BlockUI". When BlockUI is called the parent window is not accessable. You can do what you want on the modal then call "UnblockUI" to close the popup and give parent control again.
查看“BlockUI”中的Jquery插件。调用BlockUI时,父窗口不可访问。您可以在模态上执行所需操作,然后调用“UnblockUI”关闭弹出窗口并再次给出父控件。
Pete