example.ejs 336 B

12345678910111213141516
  1. <?js
  2. var user = 'Erubis';
  3. var list = ['<aaa>', 'b&b', '"ccc"'];
  4. ?>
  5. <p>Hello @{user}@!</p>
  6. <table>
  7. <tbody>
  8. <?js var i; ?>
  9. <?js for (i = 0; i < list.length; i++) { ?>
  10. <tr bgcolor="@{i % 2 == 0 ? '#FFCCCC' : '#CCCCFF'}@">
  11. <td>@{i + 1}@</td>
  12. <td>@{list[i]}@</td>
  13. </tr>
  14. <?js } ?>
  15. </tbody>
  16. </table>