/[suikacvs]/www/test/charset/singlebyte/table.html
Suika

Contents of /www/test/charset/singlebyte/table.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download) (as text)
Fri Jun 6 14:04:45 2008 UTC (17 years, 1 month ago) by wakaba
Branch: MAIN
File MIME type: text/html
New

1 <!DOCTYPE HTML>
2 <body>
3
4 <table>
5 <thead>
6 <tr><th>Original Byte<th>Result String
7 <tbody>
8 </table>
9
10 <iframe style=display:none></iframe>
11
12 <script>
13 var charset = (location.search || '?').substring (1);
14 var iframe = document.getElementsByTagName ('iframe')[0];
15 var tbody = document.getElementsByTagName ('tbody')[0];
16 var nextByte = 0x00;
17
18 doNext ();
19
20 function doNext () {
21 if (nextByte <= 0xFF) {
22 if (document.all && !window.opera) {
23 iframe.onreadystatechange = function () {
24 if (this.readyState == 'complete') {
25 addTableRow ();
26 }
27 };
28 } else {
29 iframe.onload = addTableRow;
30 }
31 iframe.src = 'charset.cgi/' + encodeURIComponent (charset)
32 + '?' + nextByte++;
33 } else {
34 iframe.onload = null;
35 iframe.onreadystatechange = null;
36 }
37 } // doNext
38
39 function addTableRow () {
40 var tr = document.createElement ('tr');
41
42 tr.appendChild (document.createElement ('th'))
43 .appendChild (document.createTextNode ('0x' + (nextByte - 1).toString (16).toUpperCase ()));
44
45 var td = tr.appendChild (document.createElement ('td'));
46 var docbody = iframe.contentWindow.document.body;
47 var value = docbody.firstChild ? docbody.firstChild.data : '';
48 for (var i = 0; i < value.length; i++) {
49 td.appendChild (document.createTextNode ('U+' + value.charCodeAt (i).toString (16).toUpperCase () + ' '));
50 }
51
52 tbody.appendChild (tr);
53
54 doNext ();
55 } // addTableRow
56 </script>

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24