Home >Web Front-end >JS Tutorial >js closes the child window when closing the parent window_javascript tips

js closes the child window when closing the parent window_javascript tips

WBOY
WBOYOriginal
2016-05-16 17:38:391235browse

Write in the parent window:

Copy code The code is as follows:

var sonid = window.open ('"
url2 "', 'newwindow', 'height=108, width=200, top="
top ",left=" left
", toolbar=no, menubar=no, scrollbars=no, resizable=no ,location=no, "
"status=no,titlebar=no,z-look=1,depended=yes,alwaysRaised=yes')

window.attachEvent("onunload", closeSonwin);
function closeSonwin()
{
sonid.close();
}


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn