Solved

HTML Page Management

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now