blob: 738ceee5293aaccd39e87d9f1fc0e0ba2a2f6b98 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
<body>
Child.
<iframe id="grandchild" src="change_grandchild.html"></iframe>
</body>
<script>
var timer = window.setInterval(poll, 100);
function poll() {
if (document.body.getAttribute("data-contains-grandchild")) {
var grandchild = document.getElementById("grandchild");
window.frameElement.parentNode.appendChild(grandchild);
window.clearTimeout(timer);
}
}
</script>
|