Search

11/16/2009

javascript templating

Closure Templates
#haml
EJS - JavaScript Templates
test.ejs // template file


<%= title %>



    <% for(var i=0; i<supplies.length; i++) { %>

  • <a href='supplies/<%= supplies[i] %>'>
    <%= supplies[i] %>
    </a>

  • <% } %>

test.html



another form: // put data in comments.json

new EJS({url: 'comments.ejs'}).update('element_id', '/comments.json')

沒有留言: