Jump to content

Closing child window and opening a new window


realjumper

Recommended Posts

Hi,

 

My popup window gets closed onClick of the link as in the code below. It also refreshes the parent window to a new location. This works fine but what I would now like to do is to leave the parent window as it is, but open a new window instead of refreshing the parent window to a new location....the parent window can just stay where it is. So, the child window would close onClick, a new window would be opened, and the parent window can just stay where it is.

 

I can't seem to get this right so if anyone can help I would be grateful. Thanks.

 

 

Here's my code......with a bit of php

 


<script type="text/javascript">
function closeMe(){
  if (opener && !opener.closed) opener.location.href = "apply.php?id=<?php echo "$row->id"; ?>";
  window.close();
}
</script>


<?php

echo "<br><b><div class=eventfont><b>Attend This Event:</b> <a href=\"#\" onclick=\"setTimeout('closeMe()', 1)\">Apply Here</a></div>\n";

?>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.