1 |
wakaba |
1.1 |
<!DOCTYPE html> |
2 |
|
|
<html lang="en"> |
3 |
|
|
<head> |
4 |
|
|
<title>DocumentFragment1.replaceChild (DocumentFragment1, |
5 |
|
|
DocumentFragment1.lastChild)</title> |
6 |
|
|
<script src="../dumptree.js" type="text/javascript"></script> |
7 |
|
|
</head> |
8 |
|
|
<body> |
9 |
|
|
<h1><code><var>DocumentFragment1</var>.replaceChild |
10 |
|
|
(<var>DocumentFragment1</var>, |
11 |
|
|
<var>DocumentFragment1</var>.lastChild)</code></h1> |
12 |
|
|
|
13 |
|
|
<div id="test-result"></div> |
14 |
|
|
|
15 |
|
|
<script type="text/javascript" id="test-code"> |
16 |
|
|
dumptree (function () { |
17 |
|
|
var df = document.createDocumentFragment (); |
18 |
|
|
df.appendChild (document.createTextNode ('text1')); |
19 |
|
|
df.appendChild (document.createElement ('element1')) |
20 |
|
|
.appendChild (document.createTextNode ('text1.1')); |
21 |
|
|
df.appendChild (document.createTextNode ('text2')); |
22 |
|
|
df.replaceChild (df, df.lastChild); |
23 |
|
|
return df; |
24 |
|
|
}); |
25 |
|
|
</script> |
26 |
|
|
|
27 |
|
|
</body> |
28 |
|
|
</html> |