realjumper Posted September 18, 2007 Share Posted September 18, 2007 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"; ?> Quote Link to comment Share on other sites More sharing options...
nogray Posted September 18, 2007 Share Posted September 18, 2007 Change this line if (opener && !opener.closed) opener.location.href = "apply.php?id=<?php echo "$row->id"; ?>"; to if (opener && !opener.closed) window.open("apply.php?id=<?php echo "$row->id"; ?>", '', 'width:##, height:##'); Quote Link to comment Share on other sites More sharing options...
realjumper Posted September 18, 2007 Author Share Posted September 18, 2007 That's perfect, thank you. You know, I was almost there, thinking along the same lines as yourself. Many thanks Neil Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.