Solved

HTML Page Management

Posted on 2011-02-26
4
251 Views
Last Modified: 2012-05-11
From one page I have a button that opens a new window & allows the visitor to add items that are stored in the database. Both pages are php scripts. When the opened window is closed, I want to "refresh" (reload)  the opener. Can I do that in JavaScript?
0
Comment
Question by:Richard Korts
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 

Author Comment

by:Richard Korts
ID: 34989744
To Experts. My problem is almost identical to this one:

http://forums.whirlpool.net.au/archive/540489

Does not look like they got a solution.
0
 
LVL 9

Expert Comment

by:rg20
ID: 34989753
Javascript recognizes it as a parent window, but you would have to reload the parent before closing the child

You can pass back the parameters of the child window to the parent as well

http://codepunk.hardwar.org.uk/bjs12.htm
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 34989774
Check this :


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Document sans nom</title>
<script language="javascript">
	var mychild;
	function test() {
		mychild = window.open("mychild.html");
		mychild.onbeforeunload = function() {
			alert("reloading!!!");
			document.location.reload(true);
		}
	}
</script>
</head>
<body onload="alert('page loaded');">
<input type="button" value="test" onclick="test();" />
</body>
</html>

Open in new window

0
 

Author Closing Comment

by:Richard Korts
ID: 34993617
Works perfect!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

634 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question