Refreshing the Parent

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I have a link on Parent.html which brings up Child.html in a separate
browser window.  Child.html has a button with Javascript to close
itself. Is there a way I can cause Parent.html to be refreshed/reloaded
after Child.html is closed?

I don't care if it can be done in HTML, Javascript or PHP, just so it
can be done.  Is there a way to do this?


Re: Refreshing the Parent

Mark wrote:

Quoted text here. Click to load it

No.  But you can refresh/reload it before or when the window displaying
Child.html is closed.

  if (window.opener && !window.opener.closed)
    // or whatever you call refresh/reload


Quoted text here. Click to load it

You are mixing up things.  HTML is a markup language, J(ava)Script and PHP
are programming languages.  You need a programming language to do this.

BTW, PHP is on topic in comp.lang.php, not in ciwa._html_.  The appropriate
newsgroup for this unspecified a question would have been only

F'up2 cljs


Re: Refreshing the Parent

Quoted text here. Click to load it

There are just so many things wrong with that, on so many levels.
Just the first three that I thought of:

(1) Don't open or close windows on my desktop, please. I know how to
operate my own browser, thank you very much.

(2) Especially don't do things that depend on Javascript, since they
will fail for a significant minority of visitors.

(3) Don't reinvent the wheel. I already know how to close a window.
"Close" buttons are amateurish, even apart from the fact that they
don't work.

Stan Brown, Oak Road Systems, Tompkins County, New York, USA
HTML 4.01 spec: /
validator: /
CSS 2.1 spec: /
validator: /
Why We Won't Help You:

Re: Refreshing the Parent

This may be minutely possible as long as the parent.html and child.html
pages are opened in a frameset.  In that case, then you can refresh the
web page to load Parent.html again while removing the frame for
Child.html.  An example of this would be:
   <frameset cols="50%,50%">
   <frame src="Parent.html">
   <frame src="Child.html">

For Child.html you would have to add in a script running a function
using the onClick attribute of buttons.  The script might look like
   <script language="JavaScript">
   function close_child()
   location.href = "Parent.html";

You would have previously inserted a button looking like this in code:
   <input type=button name="close" value="close this window"

You may want to vary the width of the frames and any other simple
features to fit your pages properly.

Site Timeline