Jump to content

Close popup window and navigate to another page


Recommended Posts

Hi,

I use the script below to close a popup window containing a submission form. On most occasions the script is fine as it is, as it closes the popup and refreshes the parent page (dashboard). There is however one occasion where my users will enter the popup from another page, but they should still be sent to the dashboard page when the popup close. How can the script be modified to work like that?

Regards,

Frode

 

<script>
function cb_close()
{

if (window.opener && !window.opener.closed) {

window.opener.location.reload();
//window.opener.location.href = "url popup window";

}
window.close();

var test= window.self;
test.opener = window.self;
test.close();

}
setTimeout("cb_close()",1000);
</script> 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...