Solved

HTML Page Management

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…

856 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