From my child window. I am trying to update the parent window. I tried several js functions to update or change the url of the parent window, and they did not give me what I needed.
alert(window.opener.location.href);
window.opener.location.assign("www.google.com");
window.opener.location.replace("www.google.com");
window.opener.location.href = "www.google.com";
window.opener.location = "www.google.com";
I also tried parent.location.hrefbut did not change the parent URL.
Is there a way to set the parent url to the required url? or just refresh the page? Any ideas?
EDIT
I cannot post sample code because what I'm doing is a bit complicated. I use the Salesforce button, which brings up a new window (asp.net page). I do not have much access to this page other than the .aspx page. This is a compiled version of the project that we bought. On the .aspx page, Im trying to call the js function because I don't have access to the code behind this page. My js function should refresh the parent page as soon as the user clicks the button (yes or no).
<cc1:ImageButton ID="btnNo" runat="server" OnClick="btnNo_Click"
OnClientClick="pop()" Text="No" Width="40px" />
<script type="text/javascript" language="JavaScript">
function pop(){
window.opener.location.reload(true);
}
</script>
source
share