forked from jeresig/env-js
-
Notifications
You must be signed in to change notification settings - Fork 76
/
iframe.html
37 lines (34 loc) · 1.46 KB
/
iframe.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en" dir="ltr" id="html">
<head>
<title>Content document for IFRAME element in env.js unit test suite</title>
</head>
<body onload="checkEventsWithinIframe(this);">
<p id="anElementWithText">
This is the text content of a paragraph element.
</p>
<!-- elements and scripting here match test cases in ../unit/window.js -->
<script>//ensure that we can execute JS inline while loading
document.write(
'\x3cp id="js_generated_p"\x3eDynamically-generated\x3c/p\x3e');
</script>
<script>//verify that our "document" object actually points to this page
document.write('\x3cp id="internalDocRefResult"\x3e');
if (document.getElementById('anElementWithText'))
document.write("First paragraph element exists-found.");
else
document.write("Eeek! Didn't find paragraph id=anElementWithText.");
document.write('\x3c/p\x3e');
</script>
<script>// append 'p id=appended "An appended paragraph"' to doc....
function checkEventsWithinIframe(body_elem){
var t = document.createTextNode("An appended paragraph");
var p = document.createElement("p");
p.setAttribute("id", "appended");
p.appendChild(t);
body_elem.appendChild(p);
}
</script>
</body>
</html>