The Little Guy Posted March 9, 2010 Share Posted March 9, 2010 I don't remember how to do this, but when my popup window opens, there is a link in the window. When a person clicks on the link I want it to open a new tab in the main window (the one that opened the popup) and go to a specific page... how do I do this? Javascript: function chatPop(){ newwindow=window.open('http://umok.us/connect/chat.php','chatwindow','height=500,width=510,resizable=no,scrollbars=no'); if (window.focus) {newwindow.focus()} return false; } once this window opens, I wan't the link that the user clicks on to open a new page in the parent window. Quote Link to comment https://forums.phpfreaks.com/topic/194583-popup-link-open-page-in-parent-window/ Share on other sites More sharing options...
haku Posted March 9, 2010 Share Posted March 9, 2010 <a href="something.com" target="_blank">link</a> Though to be honest, I'm a strong opponent to using the target attribute to open up new windows/tabs for a user. If the user wants to open a new tab, they can do it themselves. You shouldn't make that decision for them. Drives me nuts when sites do that. Quote Link to comment https://forums.phpfreaks.com/topic/194583-popup-link-open-page-in-parent-window/#findComment-1023369 Share on other sites More sharing options...
The Little Guy Posted March 9, 2010 Author Share Posted March 9, 2010 <a href="something.com" target="_blank">link</a> Though to be honest, I'm a strong opponent to using the target attribute to open up new windows/tabs for a user. If the user wants to open a new tab, they can do it themselves. You shouldn't make that decision for them. Drives me nuts when sites do that. If it opens in the current window, it interrupts the session and ends it which would piss you off more since this is a chat window. Anyways that works! I thought using that would open in the current window, not the parent Thanks for the help! Quote Link to comment https://forums.phpfreaks.com/topic/194583-popup-link-open-page-in-parent-window/#findComment-1023386 Share on other sites More sharing options...
haku Posted March 9, 2010 Share Posted March 9, 2010 Ahh, ya, that is definitely one of the few situations where I definitely want it to open in another window/tab! Quote Link to comment https://forums.phpfreaks.com/topic/194583-popup-link-open-page-in-parent-window/#findComment-1023405 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.