SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Refresh HELP!!!

  1. #1
    SitePoint Addict
    Join Date
    Aug 2000
    Posts
    248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Refresh HELP!!!

    I am trying to close a window and at the same time refresh the original page that opened the window.

    One Thing though: The page that opens the window is part of a FRAMESET.

    This works in IE on a PC but not Netscape (PC/Mac) or IE on a MAC:

    Code:
     <form name="form1" method="post" action="javascript:window.opener.location.reload()">
    		  <a href="javascript:document.form1.submit()" onClick="setTimeout('window.close()',200)">For more info click here.</a>
    </form>
    Note: the space between Java and script in the above code was placed there by the Sitepoint code parser not by me.

    Any ideas or modifications that can be done so that the frame that opened the window will refresh when closing the window?


    Thank you in advance

  2. #2
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm a little confused -- that script is IN the popup right? And you want to close the popup then reload the window.

    What is the name of the FRAME that opened it? Have you tried refreshing that instead of using window.opener (since you should know the name of it). That could work.
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  3. #3
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Additionally, I don't think you can have an <a> tag with both an onClick and and href attribute.

    Why not just write a function which will fire all of these systematically?

    Code:
    <script language="javascript">
    function formSubmit() {
      
      //submit your form
      document.form1.submit();
    
      //refresh your frame
      window.opener.location.reload();
      
      //close your window
      setTimeout('window.close()',200);
    
      /*
        not sure why you're waiting to close your window.
        these events will fire synchronously, so you can
        now safely close the window.
    
        window.close();
      */
    
    }
    </script>
    
    <form name="form1" method="post" action="">
    		  <a href="#" onClick="formSubmit()">For more info click here.</a>
    </form>


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
  •