Computing.Net > Forums > Web Development > Reload other page from popup window

Reload other page from popup window

Reply to Message Icon

Original Message
Name: kumschick
Date: May 9, 2005 at 14:50:41 Pacific
Subject: Reload other page from popup window
OS: Windows XP Media Center 2
CPU/Ram: 3,06GHz / 1GB DDR
Comment:

hi,

how do i refresh a window from a popup window? the main window is a framed window.

I want to reload the frame='mrm_main' from the popup window when closing by using:

close window



Report Offensive Message For Removal


Response Number 1
Name: Michael J (by mjdamato)
Date: May 10, 2005 at 01:05:16 Pacific
Subject: Reload other page from popup window
Reply: (edit)

If the frame you want to refresh is the same one that initiated the popup, then you can use this:

window.opener.document.location.href="PageToRefres.htm";

You can change (or refresh) the parent window using this:

window.opener.parent.document.location.href="PageToRefres.htm";

And, you can target a specific frame in the parent document like this:

window.opener.parent.frameName.location.href="PageToRefres.htm";

Note, in the JS object model, frames are also included in an array starting at 0 from the top left to the bottom right. So instead of the frame name, you could also use frames[n]

In all these examples, I am assuming that you know the name of the HTML file that is already loaded into the frame and you can just "reload" it using the location.href. If you do not know the document already loaded into the page/frame, there might be a way to do a reload of the current document, but it escapes me right now. In any event, the above examples show how you can target specific parts of the parent document.

Michael J


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Reload other page from popup window

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




How often do you use Computing.Net?

Every Day
Once a Week
Once a Month
This Is My First Time!


View Results

Poll Finishes In 3 Days.
Discuss in The Lounge