~ubuntu-branches/ubuntu/saucy/ruby-erubis/saucy

« back to all changes in this revision

Viewing changes to test/data/users-guide/example_js.result

  • Committer: Package Import Robot
  • Author(s): Laurent Bigonville
  • Date: 2012-01-26 15:15:58 UTC
  • Revision ID: package-import@ubuntu.com-20120126151558-9u7mnf9ooqnw3bwz
Tags: upstream-2.7.0
ImportĀ upstreamĀ versionĀ 2.7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
$ erubis -l js example.ejs
 
2
var _buf = [];
 
3
   var user = 'Erubis';
 
4
   var list = ['<aaa>', 'b&b', '"ccc"'];
 
5
 
 
6
_buf.push("<html>\n\
 
7
 <body>\n\
 
8
  <p>Hello "); _buf.push(user); _buf.push("!</p>\n\
 
9
  <table>\n\
 
10
   <tbody>\n");
 
11
     var i; 
 
12
     for (i = 0; i < list.length; i++) { 
 
13
_buf.push("    <tr bgcolor=\""); _buf.push(i % 2 == 0 ? '#FFCCCC' : '#CCCCFF'); _buf.push("\">\n\
 
14
     <td>"); _buf.push(i + 1); _buf.push("</td>\n\
 
15
     <td>"); _buf.push(list[i]); _buf.push("</td>\n\
 
16
    </tr>\n");
 
17
     } 
 
18
_buf.push("   </tbody>\n\
 
19
  </table>\n\
 
20
 </body>\n\
 
21
</html>\n");
 
22
document.write(_buf.join(""));