Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
See more:
I am using two pop up window how to reload first window (mean Parent window) closing second popup window
Posted
Updated 10-Sep-13 23:23pm
v2

Try window.opener.reload(true);

EDIT
----------------
I have created a sample for you

Parent.htm
HTML
<html>
<head>
<script language="javascript">
var d=new Date();
document.write(d);
</script>
</head>
<body>
<input type="button" value="open popup" onclick="window.open('pop1.htm')"/>
</body>
</html>

Pop1.htm
HTML
<html>
<head>
<script language="javascript">
var d=new Date();
document.write(d);
</script>
</head>
<body>
<input type="button" value="open popup" onclick="window.open('pop2.htm')"/>
<input type="button" value="close popup" onclick="self.close(); window.opener.location.reload(false); "/>
</body>
</html>

Pop2.htm
HTML
<html>
<head>
</head>
<body>
<input type="button" value="open popup" onclick="window.open('pop2.htm')"/>
<input type="button" value="close popup" onclick="self.close(); window.opener.location.reload(false); "/>
</body>
</html>
 
Share this answer
 
v2
Comments
manikjeyam 11-Sep-13 5:45am    
sorry its not working
thatraja 11-Sep-13 5:47am    
show your code. I have used the same code in past.
manikjeyam 11-Sep-13 5:52am    
I have used two pop up window first pop up window open Parent window second pop up window open on first pop up window now i am closing second pop up window how to reload parent window
thatraja 11-Sep-13 6:20am    
Check my updated solution
manikjeyam 11-Sep-13 7:15am    
Not working
Try the below code in your popup

C#
window.onunload = function(){
  window.opener.location.reload();
};
 
Share this answer
 
Comments
manikjeyam 11-Sep-13 6:03am    
sorry i dont get you code
Brij 11-Sep-13 6:05am    
Put the above javascript code in your child window. This should be fired when your child window unloaded/closed
try this way
JavaScript
<script language="javascript" type="Text/Javascript">
  window.onunload = function(){
  window.opener.location.reload();
};
</script>
 
Share this answer
 
I am using only one pop up window so it can reload parent window easily thanks for all the replied friends.If i can use two pop up window my parent windows not load so i am using div tag
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900