Skip to content

Commit a84ce22

Browse files
committed
Minor change
1 parent cba3cb5 commit a84ce22

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/samples/misc/testIFrame.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@
88

99
<script>
1010
var f = document.getElementById("frame0");
11-
alert("width: " + f.contentWindow.document.getElementById("frame0").width);
12-
alert("height: " + f.contentDocument.getElementById("frame0").height);
11+
12+
if (f.contentWindow) {
13+
alert("width: " + f.contentWindow.document.getElementById("frame0").width);
14+
}
15+
16+
if (f.contentDocument) {
17+
alert("height: " + f.contentDocument.getElementById("frame0").height);
18+
}
1319
</script>
1420
</html>

0 commit comments

Comments
 (0)