playaz Posted August 7, 2009 Share Posted August 7, 2009 Hi guys, This is probably really simple but I am not sure how it is done. Basically, I have a page (page 1) that has a standard text link that when the user clicks the link opens this in a new pop-up window (page 2) - in the new window when the user clicks a link it should close the pop-up and load this new URL in initial page (page 1). So in simple terms, page 1 is always there, while page 2 closes itself when a link from within page 2 is clicked.. Any ideas or code on how I can achieve this? Thanks in advance Quote Link to comment Share on other sites More sharing options...
watsmyname Posted August 7, 2009 Share Posted August 7, 2009 Hi guys, This is probably really simple but I am not sure how it is done. Basically, I have a page (page 1) that has a standard text link that when the user clicks the link opens this in a new pop-up window (page 2) - in the new window when the user clicks a link it should close the pop-up and load this new URL in initial page (page 1). So in simple terms, page 1 is always there, while page 2 closes itself when a link from within page 2 is clicked.. Any ideas or code on how I can achieve this? Thanks in advance page 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script> function open_window() { window.open('2.html','pwindow','status=1'); } </script> </head> <body> <a href="javascript:open_window()">Open Popup</a> </body> </html> page2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script> function open_window() { window.opener.document.location.href="http://www.google.com"; window.close(); } </script> </head> <body> <a href="javascript:open_window()">Open page in parent window</a> </body> </html> Quote Link to comment Share on other sites More sharing options...
playaz Posted August 7, 2009 Author Share Posted August 7, 2009 Thanks for the quick reply 'whatsmyname' I will give your code a whirl :-) Quote Link to comment Share on other sites More sharing options...
watsmyname Posted August 7, 2009 Share Posted August 7, 2009 Thanks for the quick reply 'whatsmyname' I will give your code a whirl :-) its watsmyname okay sure thing, after you think it works dont forget to mark topic as "SOLVED" Quote Link to comment Share on other sites More sharing options...
playaz Posted August 13, 2009 Author Share Posted August 13, 2009 cheers watsmyname - i scan read it without reading it properly must be my selective memory! thanks! 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.