title: XMLHttpRequest slow...how to do the same thing quicker?
body: <p>this is the function I'm using to load my Handlebars template from the file. I found it very slow even if I'm loading local file. In my opinion the XMLHttpRequest() is not very vast for local files. Is there a way to do the same thing with eg. jQuery get() or something quicker? Thanks</p>
  
  <pre><code>function getTemplate (name, callback, dir) {
    if (dir === undefined) dir = ''
    var xhr = new XMLHttpRequest()
    var url = '/scripts/templates/' + dir + name + '.html'
    xhr.open('GET', url, true)
    xhr.onreadystatechange = function () {
      if (xhr.readyState == 4 &amp;&amp; xhr.status == 200) {
        var raw = xhr.responseText
        var compiled = Handlebars.compile(raw)
        callback(compiled)
      }
    }
    xhr.send()
  }
  </code></pre>
  
  <p>example of usage:</p>
  
  <pre><code>getTemplate('no-results', function (tmp) {
      $(historyContainer).append(tmp())
    })
  </code></pre>