diff options
author | Vincent Sanders <vince@netsurf-browser.org> | 2012-11-19 17:26:23 +0000 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2012-11-19 17:26:23 +0000 |
commit | 7757008433c414974c527c4745e64aa5976d606a (patch) | |
tree | 0b227136a8c9ebd06a6bf30847ef1a811d0b04ee | |
parent | bb6b546b4be757cd515253cd10eccadf78e9afb6 (diff) | |
download | netsurf-7757008433c414974c527c4745e64aa5976d606a.tar.gz netsurf-7757008433c414974c527c4745e64aa5976d606a.tar.bz2 |
add window enumeration test
-rw-r--r-- | test/js/event-onload.html | 29 | ||||
-rw-r--r-- | test/js/index.html | 1 | ||||
-rw-r--r-- | test/js/window-enumerate.html | 26 |
3 files changed, 56 insertions, 0 deletions
diff --git a/test/js/event-onload.html b/test/js/event-onload.html new file mode 100644 index 000000000..aede985a4 --- /dev/null +++ b/test/js/event-onload.html @@ -0,0 +1,29 @@ +<html> +<head> +<title>createTextNode onload example</title> + +<script type="text/javascript"> + +function addTextNode() +{ +var newtext = document.createTextNode(" Some text added dynamically. "); +var para = document.getElementById("p1"); +para.appendChild(newtext); +} + +</script> +</head> + +<body> +<div style="border: 1px solid red"> +<p id="p1">First line of paragraph.<br /></p> +</div><br /> + +<button onclick="addTextNode();">add another textNode.</button> + +<script> +window.onload = addTextNode; +</script> + +</body> +</html> diff --git a/test/js/index.html b/test/js/index.html index 75008701b..7a17c95d3 100644 --- a/test/js/index.html +++ b/test/js/index.html @@ -8,6 +8,7 @@ <h2>Window</h2> <ul> <li><a href="window.lately.html">location</a></li> +<li><a href="window-enumerate.html">enumerate</a></li> </ul> <h2>Document write</h2> diff --git a/test/js/window-enumerate.html b/test/js/window-enumerate.html new file mode 100644 index 000000000..92a3111ae --- /dev/null +++ b/test/js/window-enumerate.html @@ -0,0 +1,26 @@ +<html> +<head> +<title>window interface enumeration</title> +<link rel="stylesheet" type="text/css" href="tst.css"> +</head> +<body> +<h1>window interface enumeration</h1> + +<script> +function output(x,y) { + document.body.appendChild(document.createTextNode(x)); + document.body.appendChild(document.createTextNode("(")); + if (y != undefined) { + document.body.appendChild(document.createTextNode(y.length)); + } + document.body.appendChild(document.createTextNode(") = ")); + document.body.appendChild(document.createTextNode(y)); + document.body.appendChild(document.createElement('br')); +} + +for(var key in window) { + output(key, window[key]); +} +</script> +</body> +</html> |