chaplinjs/chaplin

jQuery#html => setHTML doesn't work in IE11 on win7

paulmillr opened this issue · 2 comments

var setHTML = (function() {
  if ($) {
    return function(elem, html) {
      // Does not work
      // return elem.html(html);

      // Works.
      elem.empty();
      elem.append(html);
      return html;
    };
  } else {
    return function(elem, html) {
      return elem.innerHTML = html;
    };
  }
})();

Those two are not equal. jQuery pulls out <script>s of HTML and executes them. innerHTML sets parser-inserted flag on them and they are not executed. I will address this issue in new PR if you do not mind.

Not executing scripts inside html does not seem to pose an issue for us. Let's leave this as-is