I have 2 FireFox (version 2) browser windows opened.
One is the child of the other.
When the user is finished with the child window, a method in the parent window is called to refresh a section of the page.
This is the JavaScript code that I'm using to refresh the content in the parent page:
Please note that the __doPostBack() method is supplied by ASP.NET. This method submits the page to the server and indicates that the control that caused this to happen was a button with the ClientID of "myASPButtonCli entID". This method determines whether or not the whole page should be updated or if an asynchronous call to the server should take place. Since the button with the clientID of "myASPButtonCli entID" is within an ASP.NET UpdatePanel, the __doPostBack() method preforms an asynchronous call to the server and only a portion of the page is updated.
This is the JavaScript code in the child page that is used to call the UpdateList JavaScript method in the parent page:
The "CloseBrowserWi ndow" method is called when a Button is clicked. It's supposed to close the window, which triggers the window.onbefore unload event to fire, which calls the method in the parent window.
Right now the JavaScript responsible for closing the browser window is commented-out. The reason is because in FireFox version 2, when the child window is closed, the postback to the server times out.
When the child window remains opened, the request does not time out and everything works as it should (as it does in FireFox 3).
I'm not sure why this is happening (in FireFox version 2..) It'd be nice to know the reason but I'm not expecting JavaScript experts to know the mysteries of FireFox (version 2)
As a work around, I was thinking that if I were able to close the child window from the parent window the problem could be averted.
The only thing is, I have no idea how to do this.
I'd really appreciate any insight on this topic.
Thanks,
-Frinny
One is the child of the other.
When the user is finished with the child window, a method in the parent window is called to refresh a section of the page.
This is the JavaScript code that I'm using to refresh the content in the parent page:
Code:
<script type="text/javascript">
function UpdateList() {
showUpdatingMessage();
document.getElementById('myHiddenFieldForStuff').value = true;
__doPostBack('myASPButtonClientID', '');
}
</script>
This is the JavaScript code in the child page that is used to call the UpdateList JavaScript method in the parent page:
Code:
<script type="text/javascript">
window.onbeforeunload = CloseEvent;
function CloseEvent() {
if (window.opener && !window.opener.closed) {
window.opener.UpdateList();
}
}
function CloseBrowserWindow() {
//window.close();
CloseEvent();
}
</script>
Right now the JavaScript responsible for closing the browser window is commented-out. The reason is because in FireFox version 2, when the child window is closed, the postback to the server times out.
When the child window remains opened, the request does not time out and everything works as it should (as it does in FireFox 3).
I'm not sure why this is happening (in FireFox version 2..) It'd be nice to know the reason but I'm not expecting JavaScript experts to know the mysteries of FireFox (version 2)
As a work around, I was thinking that if I were able to close the child window from the parent window the problem could be averted.
The only thing is, I have no idea how to do this.
I'd really appreciate any insight on this topic.
Thanks,
-Frinny
Comment