SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member MikeN's Avatar
    Join Date
    Nov 2003
    Location
    IL
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Refresh Popup Help

    Alright here is the background.

    I have a table of names and a link to "add" them.
    looks like this.

    Bruce Unk Name - ADD
    Steve Unk Name - ADD
    Bruce Unk Name - ADD
    Steve Unk Name - ADD

    When the click add, I open a popunder form using some js that i found.
    The popunder is in asp and has a table with all the users that have been added listed in it.

    My problem: when the click add on the first person, i open the popunder with the one person's name in the table. when the click the second name, i need to either refresh the popunder asp page to load up the second name, or i need to open the page again in the same window as the popunder, to simulate refreshing it.

    i found opener.location.reload(true); to reload a parent page, but i need to reload a child page..

    One Hundred Points to anyone that can offer a soluntion.

    Thanks.

    eM

  2. #2
    SitePoint Enthusiast kgish's Avatar
    Join Date
    Dec 2001
    Location
    Gouda, The Netherlands
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not sure I quite get your problem. Perhaps an linked example could be useful?
    Kiffin
    Your average future-famous kind of guy...

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    Maryland, USA
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi MikeN,
    Not sure if you still need this or not, but here is what I came up with.

    For the parent page you would need...
    Code:
    <HTML>
    <HEAD>
    	<TITLE>Parent Window: Characters</TITLE>
    <SCRIPT LANGUAGE="JavaScript">
    // Update the value of the hidden variable 'characters'.
    function addCharacter( character_ )
    {
    	// Add a character to the hidden variable 'characters'.
    	if ( document.forms[0].characters.value == "" )
    	{
    		document.forms[0].characters.value = character_;
    	}
    	else
    	{
    		document.forms[0].characters.value += "," + character_;
    	}
    	
    	refreshChildWindow( "characterWindow.html" );
    }
    
    // Open a child window named 'childWindow'.
    function refreshChildWindow( linkLocation_ )
    {
    	// To refresh the child window, the child window name must be the same.
    	childWindow = window.open( linkLocation_, "childWindow", "" );
    	childWindow.focus();
    }
    </SCRIPT>
    </HEAD>
    
    <BODY>
    <FORM>
    	Parent Window<BR>
    	<A HREF="##" ONCLICK="addCharacter( 'A' );">A</A><BR>
    	<A HREF="##" ONCLICK="addCharacter( 'B' );">B</A><BR>
    	<A HREF="##" ONCLICK="addCharacter( 'C' );">C</A><BR>
    	<!-- Hidden Variable to store the value for the child window. -->
    	<INPUT TYPE="hidden" NAME="characters" VALUE="">
    </FORM>
    </BODY>
    </HTML>
    AND for the child window...
    Code:
    <HTML>
    <HEAD>
    	<TITLE>Child Window: Characters</TITLE>
    </HEAD>
    
    <BODY>
    <SCRIPT LANGUAGE="JavaScript">
    characterList = window.opener.document.forms[0].characters.value;
    characterArray = characterList.split( "," );
    
    for ( i = 0; i < characterArray.length; i++ )
    {
    	document.write( characterArray[i] + '<BR>' );
    }
    </SCRIPT>
    </BODY>
    </HTML>
    Daniel

  4. #4
    SitePoint Member MikeN's Avatar
    Join Date
    Nov 2003
    Location
    IL
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ill see what I can do with that. Thanks for your help there Daniel.

    Happy Holidays.


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
  •