SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Keep Moving Forward gold trophysilver trophybronze trophy
    Shaun(OfTheDead)'s Avatar
    Join Date
    Nov 2005
    Location
    Trinidad
    Posts
    3,746
    Mentioned
    45 Post(s)
    Tagged
    0 Thread(s)

    Pop up Open Another Pop Up??

    Hello...

    I'm using the following typical pop up script to make a pop-up window called "articleWindow". I'd like articleWindow to open another pop-up called "editorWindow", but for some reason instead of opening a third window, the address of the second is changing to where I want the third to go to.

    Is there something I'm missing??...

    Code:
    <script type="text/javascript">
    	function popArticleViewer(a)
    		{
    		articleWindow=window.open(a,'SubmitComment','width=780,height=600,scrollbars=yes,resizable=yes');
    		}
    </script>
    Code:
    <script type="text/javascript">
    	function popEditor(a)
    		{
    		editorWindow=window.open(a,'SubmitComment','width=550,height=600,scrollbars=yes,resizable=yes');
    		}
    </script>
    There must be a way to do this, right??

  2. #2
    Keep Moving Forward gold trophysilver trophybronze trophy
    Shaun(OfTheDead)'s Avatar
    Join Date
    Nov 2005
    Location
    Trinidad
    Posts
    3,746
    Mentioned
    45 Post(s)
    Tagged
    0 Thread(s)
    For anyone who may need to do this in the future...

    I've figured out how to do it myself (I'm so proud !!)

    Basically the function in the second window instructs the parent to open the third (rather than trying to let the second open the thind)... So it's like this...

    Code:
    	<script type="text/javascript">
    		function popEditor(a)
    			{
    			editorWindow=window.opener.open(a,'EditorWindow','width=550,height=600,scrollbars=yes,resizable=yes');
    			}
    	</script>
    Yaah!!

  3. #3
    Keep Moving Forward gold trophysilver trophybronze trophy
    Shaun(OfTheDead)'s Avatar
    Join Date
    Nov 2005
    Location
    Trinidad
    Posts
    3,746
    Mentioned
    45 Post(s)
    Tagged
    0 Thread(s)
    And one last thing... Make the new window the focus with this line...

    Code:
    if(window.focus) {editorWindow.focus();}
    Right, the end.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •