1 <html xmlns=
"http://www.w3.org/1999/xhtml">
3 Tests by Sam Ruby - WTFPL License (http://sam.zoy.org/wtfpl/)
5 http://www.intertwingly.net/blog/2006/10/03/Firefox-XHTML-innerHTML-quirk#comments
6 https://bugzilla.mozilla.org/show_bug.cgi?id=339350
9 <!-- XHTML needs the packed version -->
10 <script type=
"text/javascript" src=
"../MochiKit/packed.js"/>
11 <script type=
"text/javascript" src=
"SimpleTest/SimpleTest.js"/>
12 <link rel=
"stylesheet" type=
"text/css" href=
"SimpleTest/test.css" />
15 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=339350">Mozilla Bug
339350</a>
16 <div style=
"display: none">
17 <table border=
"1" cellspacing=
"0">
27 <td><div id=
"i1"/></td>
28 <td style=
"background:yellow"><div id=
"i2"/></td>
29 <td><div id=
"i3"/></td>
33 <td><div id=
"t1"/></td>
34 <td><div id=
"t2"/></td>
35 <td><div id=
"t3"/></td>
40 <script type=
"text/javascript">
41 var text1
= 'foo bar';
42 var text2
= 'foo [bar]';
43 var text3
= 'foo {bar}';
45 <!-- This is the
long way to write
this stuff
,
46 you can
use MochiKit functions too
-->
47 document
.getElementById('i1').innerHTML
= text1
;
48 document
.getElementById('i2').innerHTML
= text2
;
49 document
.getElementById('i3').innerHTML
= text3
;
51 document
.getElementById('t1').appendChild(document
.createTextNode(text1
));
52 document
.getElementById('t2').appendChild(document
.createTextNode(text2
));
53 document
.getElementById('t3').appendChild(document
.createTextNode(text3
));
55 <!-- The
is() function is one way to add a test
-->
56 is(document
.getElementById('i2').innerHTML
, text2
, "XHTML innerHTML with trailing brackets ']]'");