1 |
wakaba |
1.1 |
<!DOCTYPE HTML> |
2 |
|
|
<title>appendChild (<script>)</title> |
3 |
|
|
|
4 |
|
|
<p id=result class=FAIL>FAIL (noscript)</p> |
5 |
|
|
|
6 |
|
|
<script> |
7 |
|
|
var result = document.getElementById ('result'); |
8 |
|
|
result.firstChild.data = 'FAIL (error)'; |
9 |
|
|
|
10 |
|
|
var el = document.createElement ('div'); |
11 |
|
|
var el2 = document.createElement ('script'); |
12 |
|
|
el2.text = 'window.testValue1 = 1'; |
13 |
|
|
el.appendChild (el2); |
14 |
|
|
document.body.appendChild (el); |
15 |
|
|
</script> |
16 |
|
|
|
17 |
|
|
<script> |
18 |
|
|
if (window.testValue1) { |
19 |
|
|
result.firstChild.data = 'PASS'; |
20 |
|
|
result.className = 'PASS'; |
21 |
|
|
} else { |
22 |
|
|
result.firstChild.data = 'FAIL'; |
23 |
|
|
} |
24 |
|
|
</script> |