severndigital Posted November 17, 2007 Share Posted November 17, 2007 ok I am having problems with this one. here is what i want to do. 1. open a popup window. 2. when a specific link is click in the new window I want to close it and open the link in the original window that the popup came from. currently I have the code in place to popup the window. I can also close the window with the self.close command. can anyone help me with a function that will close the window and open a link in the original window. or is it even possible?? thanks, chris Quote Link to comment Share on other sites More sharing options...
AndyB Posted November 17, 2007 Share Posted November 17, 2007 http://www.irt.org/script/window.htm It's all in there somewhere. Quote Link to comment Share on other sites More sharing options...
severndigital Posted November 17, 2007 Author Share Posted November 17, 2007 thanks for that link .. i found what i was looking for. for anyone else .. this how i did it. in the popup window head <script language="JavaScript"> opener.name = 'main'; //name the opener function closePopup(link){ window.open(link ,'main'); self.close(); } </script> then on the link you want to use add this as the href <a href="javascript:closePopup('linkyouwant.htm')">click here</a> that closes the popup and opens the link in the href in the opener window. not sure if it is the 'best practice' but it got the job done for me. thanks again, chris 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.