问题
I have a slight variation on the window.opener.reload javascript.
Normally, if I want to reload a page after closing a pop-up window I use
window.opener.reload(true)
But this time i want to load a different url into the opener
window.
So i tried this:
window.opener.href('url').reload(true);
But this isn't working. Any ideas on why it isn't working and how I can make it work??
Thanks jw
回答1:
Assign to location.href
:
opener.location.href = "url";
回答2:
This might work (subject to same-origin policy restrictions):
window.opener.location = url;
回答3:
Try this instead:
window.opener.location.href = "somepage.htm";
回答4:
You dont need to reload page when set a new uri (second case) you must code directly:
opener.location.href = "url";
来源:https://stackoverflow.com/questions/7599382/javascript-popup-window-and-reload