karthikin Posted July 27, 2011 Share Posted July 27, 2011 Hi Friends,I'm working on XUL, I have a window that opens another window. When the child window closes I want to refresh the contents of the parent.This is my first window(sundayevening.xul), which has a function to open the child window(iframetest.xul) function edit(){var windowObjectReference = window.openDialog("chrome://hello/content/iframetest.xul","iframetest", "Height=600, width=1024,resizable,scrollbars=yes,status=1" );}var sURL = unescape(window.location.pathname); function refresh(){ window.location.href = sURL;} This is my second xul file(iframetest.xul), here i have a button to close the this child window. When I close this child window, how can I refresh/reload the parent window(sundayevening.xul).In the second window, i use the following script: function closeWindow() {window.close();refresh();} My above code is not refreshing/reloading the parent window when i close the child window! Thanks for your support and help. Link to comment Share on other sites More sharing options...
karthikin Posted July 27, 2011 Author Share Posted July 27, 2011 Sorry guys found the solution. The below code works fine. Thanks guys. function closeWindow() {window.close();if (window.opener && !window.opener.closed) {window.opener.location.reload();} } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.