SQL PHP HTML ASP JavaScript articles and free scripts to download
JavaScript Tutorials
Popular Tutorials
Drop down list
Timer function
JavaScript Tutorials
String
Array
Date & Time
Form Validation
Event Handling
Math Functions
JavaScript Forum
Subscribe
Submit your email address and receive article and product notifications. Your email is safe with us.

 
 

Refreshing parent window from child window

Refreshing the parent window or main window from a child or small window is a common requirement. For example in an auction script we can display the present highest bid and we can ask the bidder to enter the bid amount by opening a child window. Here once the bid is entered and submitted the child window should close and then the parent window must refresh to display the entered bid amount. Here we will use the code at the child window to refresh the parent window. Please read the child window open and child window close tutorials before trying this. Here is the code to refresh the parent window from the child window.



Related Tutorial
Opening child window
Closing Window
Click this button to open a child window.



The code for the above button is here

<input type=button onClick=window.open("window-child2.html","Ratting","width=550,height=170,
left=150,top=200,toolbar=0,status=0,"); value="Open Window">


The code of the child window is here

<html>
<head>
<title>(Type a title for your page here)</title>

<SCRIPT language=JavaScript>
<!--
function win(){
window.opener.location.href="window-refreshing.php";
self.close();
//-->
}
</SCRIPT>


</head>


<body bgcolor="#ffffff" >


<font face='Verdana' size='2' >This is the child window opened . Click the button below to close this window and refresh the main window</font>
<br><br>
<center><input type=button onClick="win();" value="Close this window"></center>


</body>
</html>






Further readings
Displaying alert window with message
prompt window for user input
Confirm window for user choice
Opening a child window
Closing child window on click of a button
Refreshing parent window from child window
Passing of data from child window to parent window
Showing a conformation window to user before deleting
Displaying JavaScript pop up window

 
Subscribe
Submit your email address and receive article and product notifications. Your email is safe with us.

Scripts
PHP
JavaScript