JavaScript Templating Engine
<p>I would like to create <strong>universal</strong> templating engine in JavaScript, how to?</p>

<p><strong>HTML template</strong></p>

<pre><code>&lt;h1&gt;&lt;%title1%&gt;&lt;/h1&gt;
&lt;h2&gt;&lt;%title2%&gt;&lt;/h2&gt;
</code></pre>

<p><strong>JSON file</strong></p>

<pre><code>{
  "title1" : "Hello World!",
  "title2" : "Hi World!"
}
</code></pre>

<p><strong>Javascript</strong></p>

<ul>
<li>Find in HTML file &lt;%title1%></li>
<li>Find in JSON file variable "title1"</li>
<li>Replace &lt;%title1%> with value of variable "title1"</li>
</ul>

<p>Same for &lt;%title2%></p>

<p>Thanks!</p>
