Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: bcb0238e8b
Fetching contributors…
Cannot retrieve contributors at this time
55 lines (43 sloc) 1.37 KB
<script id="headertmpl" type="text/x-dot-template">
<script id="pagetmpl" type="text/x-dot-template">
<h2>Here is the page using a header template</h2>
<script id="customizableheadertmpl" type="text/x-dot-template">
{{#def.mycustominjectionintoheader || ''}}
<script id="pagetmplwithcustomizableheader" type="text/x-dot-template">
<h2>Here is the page with customized header template</h2>
<div>{{=it.title}} is not {{}}</div>
<script src="../doT.js" type="text/javascript"></script>
<div id="content"></div>
<div id="contentcustom"></div>
<script type="text/javascript">
var def = {
header: document.getElementById('headertmpl').text,
customheader: document.getElementById('customizableheadertmpl').text
var data = {
title: "My title",
name: "My name"
var pagefn = doT.template(document.getElementById('pagetmpl').text, undefined, def);
document.getElementById('content').innerHTML = pagefn(data);
pagefn = doT.template(document.getElementById('pagetmplwithcustomizableheader').text, undefined, def);
document.getElementById('contentcustom').innerHTML = pagefn(data);
Jump to Line
Something went wrong with that request. Please try again.