Solved

HTML Page Management

Posted on 2011-02-26
4
247 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
  • 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

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

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

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

773 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