leonidas / transparency

Transparency is a semantic template engine for the browser. It maps JSON objects to DOM elements by id, class and data-bind attributes.
http://leonidas.github.com/transparency/
MIT License
969 stars 112 forks source link

IE9 won't re-render template if directive is updating raw HTML #119

Open peterh-capella opened 10 years ago

peterh-capella commented 10 years ago

Had an issue when I created a template that included the need to enter HTML content instead of plain text. I started with the directive example at:

https://github.com/leonidas/transparency/wiki/Manipulate-DOM-directly-with-Transparency-and-jQuery

My directive modified the target element using jQuery's .html() method, but when IE9 was called upon to re-render the template, it choked and threw an Invalid argument error.

I've stripped the problem down and created a jsfiddle demonstrating:

http://jsfiddle.net/thejbru/5daqx/

As you can see in the fiddle, I solved the issue by wrapping the HTML I was attempting to pass into the template in a jQuery object.