Link to home
Start Free TrialLog in
Avatar of arru_in
arru_in

asked on

How to refresh my browser, when user performs some action

In my jsp page, i have a button when it is clicked i will
open a new window (using java script window.open()).
 when the new window is submitted, i need to close
the new window and refresh the main page.
How do i do it?

Thanks in advance
Arru


 
Avatar of arru_in
arru_in

ASKER

To close the new window, i tried window.close(),its working.. but how to refresh the parent window?

is there any way to do it in javascript something like window.opener.document.refresh() ?
Avatar of knightEknight
try this:

self.opener.location = ""+self.opener.location.href;
self.close();
also, where is this code in relation to the form being submitted?  is it after the form submits and returns, or is it just before the form submits?

If the later, then you want to do this in this order:

self.opener.location = ""+self.opener.location.href;
document.forms[0].submit();
setTimtout("self.close()",500);
doh!  sorry!  i put it in the wrong order myself!


self.opener.location = ""+self.opener.location.href;
setTimtout("self.close()",500);
document.forms[0].submit();


of course, by attempting this at all, there is no guarantee that the parent window will be refreshed with the form data -- IF you are doing the refresh and close BEFORE the form submits.
ASKER CERTIFIED SOLUTION
Avatar of knightEknight
knightEknight
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of arru_in

ASKER

thanks knightEknight it works.. the main page is refreshed
but i have a java script tree in the main page which is not in fully expanded form. anyway thats my problem..
thanks
Arru