Mustache.js 튜토리얼

1 개요[ | ]

mustache.js 시작하기
mustache.js 튜토리얼
<div id="greeting"></div>

<script id="greeting-template" type="x-tmpl-mustache">
  <p>안녕, <strong>{{name}}</strong>!</p>
  <p>여기는 <strong>{{here}}</strong>입니다.</p>
</script>

<script src='//cdnjs.cloudflare.com/ajax/libs/mustache.js/2.2.1/mustache.min.js'></script>
<script>
var template = document.getElementById('greeting-template').innerHTML;
Mustache.parse(template);
var rendered = Mustache.render(template, {name: "친구들", here: "제타위키"});
document.getElementById('greeting').innerHTML = rendered;
</script>

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}