Is it possible to open a pop-up window from within a pop-up window?

sjsimpson2000
sjsimpson2000 used Ask the Experts™
on
Hi, I have an html file with this script:
<script language="javascript" type="text/javascript">
<!--
function popitup(url) {
	newwindow=window.open(url,'name','height=600,width=950,scrollbars=Yes,toolbar=No,ScreenX=500,ScreenY=250');
	if (window.focus) {newwindow.focus()}
	return false;
}
// -->
</script>

Open in new window


that is executed with the URL like this:
<a href="#" onClick="return popitup('http://www.mypage.com')">Click Here!</a>

Open in new window


When I put the same code in the html file of the window that is popped up I can only get it to display in the same popped up window, or a new one.  

How can get a link in the popped up window to open another pop-up?

Thanks!!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2018
Distinguished Expert 2018
Commented:
You need to give the new window a different name. If you use the code you posted, the popup from the first page creates a window called 'name' and then you try opening it again with the same 'name'.

Unless you specifically need to name your new window, just set it to '_blank'

Author

Commented:
PERFECT!  Thank you!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial