当前位置: 首页 > 工具软件 > Mustache > 使用案例 >

mustache template

伍心水
2023-12-01
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<div id="tpl"></div>
<script type="text/javascript" src="http://twitter.github.io/hogan.js/builds/3.0.1/hogan-3.0.1.js"></script>
<script type="text/javascript">
var data = {name : "黄劲森"}
    dom  = document.getElementById("tpl"),
    tpl  = "<h1>hello,my name is  {{name}}</h1>",
    res  = "";
tpl = Hogan.compile(tpl);
res = tpl.render(data);
dom.innerHTML = res;
</script>
</body>
</html>

感谢黄劲森小伙伴辅导我【2017-02-17,周五】!

 类似资料:

相关阅读

相关文章

相关问答