Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am trying to achieve the following.

  1. A link on a parent page will open a new child pop-up.
  2. In the child pop-up, the user enters some data and clicks “Save”.
  3. Data will be saved to database and the pop-up will be closed. The parent window would be refreshed, and the data entered in the child pop-up would be displayed in the parent page.

How can this (closing a child pop-up and refreshing the parent page) be done in Javascript?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
253 views
Welcome To Ask or Share your Answers For Others

1 Answer

In the pop-up window:

<script type="text/javascript">
function proceed(){
   opener.location.reload(true);
   self.close();
}
</script>

<form onsubmit="proceed()">
...
</form>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...