You need to sign in to do that
Don't have an account?
Dipika
refresh parent window from child window in internet explorer
hi,
I want to close the child window with refreshing parent window. I have used the code.
function closePage(){
window.opener.parent.location.replace('/{$CurrentPage.parameters.id}');
window.close();
}
it is working in firfox,chrome but not working in internet explorer.
can someone suggest for internet explorer what should be the code?
Some browsers only allow the child window to be closed from the parent window that opened up. That being the case, you'd need to put your javascript into the parent window to close the child and then refresh itself.
Hi,
Try the below code in JavaScript of your child window page
window.parent.opener.location.reload(true);
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
hi,
I am opening the child window by custom button from detail page of standard object.
So i cant write code to refresh the parent page,
Is there any other solution?
hi,
Its also not working.
--window.parent.opener.location.reload(true);
Thanks
I have used
window.opener.location.reload();
and it worked from a child window. This only works on every major browser, that used javascript to open the child window.
It may refresh parent window. But does it closes the child window?
Hi
I am facing the exact issue. Did you get any solution? If so please post here.
Thanks
If you need to additionally close the child window, you just need to add 1 more line after:
window.opener.location.reload();
window.close();//This only works if the child window was created from javascript
window.opener.location.reload();
do not work even if i'm opening my child window from javascript
Is anybody having any solution for this
Try the below mentioned code, it works in IE, Chrome etc. all browsers
window.top.opener.location.href="/{!$CurrentPage.parameters.id}"; // Give here your parent page url
window.top.close();
If this solution helps you to solve your problem, please mark this question as solved.
Hi Souvik,
The above solution is the same which I have used when opening a vf from custom list button , but that opens a new tab in IE instead of refreshing parent.
Thanks
Rahul
http://javascript.info/tutorial/cross-window-messaging-with-postmessage
https://developer.mozilla.org/en-US/docs/Web/API/Window.postMessage