Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

HTML Page Management

Posted on 2011-02-26
4
Medium Priority
?
253 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 83

Accepted Solution

by:
leakim971 earned 2000 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
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…
Suggested Courses

926 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