blob: 118b447cdaf428d06bae12e3412587d81d844b9d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
<html>
<head>
<title>Remove Frame on Unload</title>
<script>
function openWindow() {
var w = window.open("title1.html");
return true;
}
window.addEventListener('unload', function() {
var f = document.getElementById("f");
document.body.removeChild(f);
}, false);
</script>
</head>
<body>
<button onclick="openWindow()">Open Window</button>
<p>Navigate to another page to cause frame to be removed.</p>
<iframe id="f" src="about:blank"></iframe>
</body>
</html>
|