Tôi đang tạo cửa sổ bật lên đi đến hello.html. Tôi muốn trang gốc của tôi (trang gốc) tải lại khi tôi đóng cửa sổ bật lên (hello.html). Tôi không thể làm cho nó hoạt động được, nhưng tôi thân thiết. Dưới đây là đoạn code tôi có cho đến nay cho trang chính và trang hello.html ....Cửa sổ làm mới dành cho cha mẹ sau khi đóng cửa sổ bật lên
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function open_win()
{
window.open("hello.html","_blank","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=400, height=400");
}
</script>
<script language="JavaScript">
function refreshParent() {
window.opener.location.href = window.opener.location.href;
if (window.opener.hello.html)
{
window.opener.hello.html.close()
}
window.close();
}
</script>
</head>
<body>
<script type="text/javascript">
var d=new Date();
document.write(d);
</script>
<form>
<input type="button" value="Open Window" onclick="open_win()">
</form>
</body>
</html>
Đây là hello.html ...
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
</script>
</head>
<body>
Hello
</body>
</html>
Vui lòng kiểm tra điều này: http://stackoverflow.com/questions/18321323/submit-form-reload-parent-and-close-child/36855748#36855748 có thể giúp ai đó – NoNaMe