admin管理员组文章数量:1187854
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.
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."
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.
- Page A is the main page.
- PageA displays PageB in a frame. PageB is a toolbar.
- PageA displays PageC in another frame. That's the content.
- PageC displays PageD in a nonmodal dialog.
- PageD, for reasons unknown to me, wants to modify the controls in PageB. It's trying to use window.opener to do that, and failing horribly.
If someone could enlighten me as to why this is the case (the code works in FF), I'd appreciate it.
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.
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."
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.
- Page A is the main page.
- PageA displays PageB in a frame. PageB is a toolbar.
- PageA displays PageC in another frame. That's the content.
- PageC displays PageD in a nonmodal dialog.
- PageD, for reasons unknown to me, wants to modify the controls in PageB. It's trying to use window.opener to do that, and failing horribly.
If someone could enlighten me as to why this is the case (the code works in FF), I'd appreciate it.
Share Improve this question edited May 23, 2017 at 10:31 CommunityBot 11 silver badge asked Oct 1, 2010 at 14:23 Mike HoferMike Hofer 17k11 gold badges79 silver badges115 bronze badges 3- Which version of IE, and which OS? If it's IE7, the issue is likely Protected Mode. If it's IE8, it's likely related to LCIE. Are you able to reproduce the problem if you start IE running as an administrator? – EricLaw Commented Oct 3, 2010 at 20:16
- IE8 with an app hosted under IIS7. I can try running IE as an administrator, but we're still using VS2008 SP1, and the debugging experience under Win7 is rather...wonky. – Mike Hofer Commented Oct 4, 2010 at 13:57
- Hi Mike, any insight in what is going on... I experience the same problem – krul Commented Oct 7, 2010 at 18:23
4 Answers
Reset to default 11Although my answer isn't directly applicable to this particular question, if you're getting this error (The callee (server [not server application]) is not available and disappeared;) when communicating between a pop-up window and the opener window, it's because the pop-up window created an object which it then passed to the opener window. When the pop-up window is closed, Internet Explorer kills all objects created by the pop-up window. And since the object is passed by reference, the object to which the opener window references is now gone. An easy workaround is to pass by value by converting the object to a JSON string using JSON.stringify. You can then convert the string back to an object in window.opener using JSON.parse().
Example:
Pop-up Window:
window.opener.callback(JSON.stringify({
id: 1,
name: "foo"
}));
Opener Window:
window.callback = function (response) {
var foo = JSON.parse(response);
};
Using this approach, the opener window is no longer referencing the object that was created in the pop-up window, so the object in the opener window will survive after the pop-up is closed.
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.
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.
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.
I had the exact same error message in following scenario: window A pop ups wind B, user search something and wind B calls wind A passing some parameter. Method called on wind A suppose to close popup wind B after it finish doing what it's doing. I was passing parameter as object: p ={a: 1, b:"c"} after I rewrite the code to pass each parameter separately error disappeared. callingMethod(1,"c");
Hope that helps somebody...
you can get this error in excel
Sub LoadParameterForm()
If frmParm Is Nothing Then
Set frmParm = New frm_setParameters
End If
frmParm.Show
end sub
Here frmParm is a module level variable. Clicking the OK button, I intend to .HIDE() the form so the user's choices are sticky. If the user clicks on the control box X and closes the form, then you essentially have frmParm pointing at something that no longer exists.
I have not found a way to test for the condition, I trap for the error, set the form to nothing and try again.
I realize this is not exactly the question being asked, but it is a concrete example of the related excel issue mentioned several times in the posts.
本文标签:
版权声明:本文标题:javascript - JS: "The callee (server [not server application]) is not available and disappeared." accessing wi 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738381129a2083955.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论