/[suikacvs]/www/test/support/result0.js
Suika

Contents of /www/test/support/result0.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download) (as text)
Sat Feb 3 03:25:57 2007 UTC (19 years, 5 months ago) by wakaba
Branch: MAIN
Changes since 1.1: +9 -1 lines
File MIME type: application/javascript
New style sheets; Tests whether there is |toString| or not for WiniE

1 wakaba 1.1 function htescape (s) {
2     return s.replace ('&', '&amp;').replace ('<', '&lt;');
3     } // htescape
4    
5     function writeResult (value) {
6     if (typeof (value) == 'undefined') {
7     document.write ('<code>undefined</code>');
8     } else if (value == null) {
9     document.write ('<code>null</code>');
10 wakaba 1.2 } else if (value.toString) {
11     var vString = value.toString ();
12     if (vString == '') {
13     document.write ('An empty string');
14     } else {
15     document.write ('<code>' + htescape (vString) + '</code>');
16     }
17     document.write (', type <code>' + htescape (typeof (value)) + '</code>');
18 wakaba 1.1 } else {
19 wakaba 1.2 var vString = '' + value;
20 wakaba 1.1 if (vString == '') {
21     document.write ('An empty string');
22     } else {
23     document.write ('<code>' + htescape (vString) + '</code>');
24     }
25     document.write (', type <code>' + htescape (typeof (value)) + '</code>');
26     }
27     } // writeResult

[email protected]
ViewVC Help
Powered by ViewVC 1.1.24