问题描述
在我们的(相当大的老)ASP.NET应用程序,我们使用了大量的装入框架,内部框架,和模态对话框(使用window.showModalDialog)页面。我们开始看到上面了不少错误,我似乎无法找到一个合理的解释为它的任何地方。
In our (quite large and old) ASP.NET application we use a lot of pages loaded into frames, iframes, and modal dialogs (using window.showModalDialog). We are starting to see the error above quite a bit, and I can't seem to find a single rational explanation for it anywhere.
-
弹出窗口阻止程序。不。我们现在还没有遇到他们。就连内置的拦截器。
Popup Blockers. Nope. We're not running them. Not even the built-in blocker.
信任区域。不。该应用程序在本地主机上,现在运行,它的受信任站点列表中。
Trusted Zone. Nope. The application runs on LocalHost right now, and it's in the trusted sites list.
杂散宇宙射线。有可能,但可能性不大。这是太一致。
Stray Cosmic Rays. Possible, but not probable. It's way too consistent.
我的没有的最终找到埋藏在微软的网站一些尘土飞扬的大部头了解检索自动化错误消息的信息。在这里面,他们在谈论的Excel,他们说:在这个例子中,Microsoft Excel是服务器应用程序的引用一旦被破坏(或关闭)工作簿对象生成错误。
I did eventually find the error message buried on Microsoft's site in some dusty tome about retrieving automation error message information. In it, they were talking about Excel, and they said: "In this example, Microsoft Excel is the server application. Referencing a workbook object once it is destroyed (or closed) generates the error."
这可能是尽可能接近我所见过为错误的原因的解释,没有一个真正的,具体的解释。的有人试图把它的处置使用的东西他们引用后。的奇怪的是,你仍然可以在屏幕上看到的窗口。然而奇怪的是,这种怀疑嫌我接受的答案来this.
That is probably as close as I've ever come to an explanation for the cause of the error, without a real, concrete explanation. Someone tried to use something after their reference to it was disposed of. Oddly, you can still see the windows on the screen. Curiously, however, this smacks suspiciously to me of the accepted answer to this.
因此,这里发生了什么。
So here's what happens.
- 网页A是主要的页面。
- 网页A显示网页B的一帧。网页B是一个工具栏。
- 网页A显示PageC另一个框架。这是内容。
- 在一个非模态对话框分页显示PageC。
- 分页,因为我的原因不明,希望修改网页B的控制。它试图用window.opener要做到这一点,和可怕的失败。
如果有人能赐教,为什么是这样的话(在code工作在FF),我AP preciate它。
If someone could enlighten me as to why this is the case (the code works in FF), I'd appreciate it.
推荐答案
我应该有这个问题前面更新,我为延迟道歉。我学到了一点,因为我张贴,这里就是我学到的东西。
I should have updated this question earlier, and I apologize for the delay. I've learned a bit since I posted it, and here's what I've learned.
有关使用window.showModalDialog打开的窗口中,window.opener方法返回null,而不是打开的窗口中参考。要获得打开的窗口中的引用,你必须把它作为一个对话框的说法。
For windows opened with window.showModalDialog, the window.opener method returns null, rather than a reference to the opening window. To get a reference to the opening window, you have to pass it as a dialog argument.
这我不清楚这点是否这是预期的行为;它显然是无证的行为。此外,根据MSDN,window.opener仅对装入框架和iframe页
It's unclear to me at this point whether or not this is intended behavior; it's apparently undocumented behavior. Further, according to MSDN, window.opener is only valid for pages loaded into frames and iframes.
这篇关于JS:"被叫方(服务器[不服务器应用程序])不可用,消失"。访问window.opener的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!