forked from jeresig/env-js
/
iframe1a.html
46 lines (41 loc) · 1.76 KB
/
iframe1a.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
38
39
40
41
42
43
44
45
46
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
* This file is a component of env.js,
* http://github.com/gleneivey/env-js/commits/master/README
* a Pure JavaScript Browser Environment
* Copyright 2009 John Resig, licensed under the MIT License
* http://www.opensource.org/licenses/mit-license.php
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en" dir="ltr" id="html">
<head>
<title>Content document 'iframe1a.html' for env.js unit test suite</title>
</head>
<body onload="checkEventsWithinIframe();">
<quote id="anotherElementWithText">
This is the text content of a block-quote element.
</quote>
<!-- 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(){
var t = document.createTextNode("An appended paragraph");
var p = document.createElement("p");
p.setAttribute("id", "appended");
p.appendChild(t);
document.getElementsByTagName('body')[0].appendChild(p);
}
</script>
</body>
</html>