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

Categories

0 votes
795 views
in Technique[技术] by (71.8m points)

javascript - refresh parent window when closing child window

How can I refresh the parent window when clicking the close button of a child window?

The child window is a pop-up.

See Question&Answers more detail:os

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

1 Answer

0 votes
by (71.8m points)

To refresh the parent page on close of child window use the following javascript in the popup page and call that using onunload in the popup page.

function refreshParent() 
{
    window.opener.location.reload(true);
}

<body onunload="javascript:refreshParent()">

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...