twigkit / tempo

Tempo is an easy, intuitive JavaScript rendering engine that enables you to craft data templates in pure HTML.
http://tempojs.com/
Apache License 2.0
709 stars 73 forks source link

Template does not render in the IE #76

Closed olutek closed 11 years ago

olutek commented 11 years ago

Hi there, I have a problem with rendering the template which is inside a table. I'm using Tempo 1.8. Here is a code example http://jsfiddle.net/lotka/G98d7/1/. Select elements are added dynamicly to the form after some special button is hit (thats when the counter gets updated). It's working great in Chrome and Firefox but of course IE (8 and 9) has a problem. I can only see "{{1}}" text on the list instead of list of concreate values. IE debbugger didn't show any errors. I've tried updating to IE 10 and suprise - it works! (actually I had to allow it to run scripts and ActiveX). I've also tried to use Tempo 2.0 but now it's not working at all in any of this browsers.

Am I doing something wrong? Is there a way to make it work in IE9? Why it isn't working at all in Tempo 2.0?

mrolafsson commented 11 years ago

There is a slight syntax difference between 1.8 and 2.0: http://jsfiddle.net/G98d7/2/

olutek commented 11 years ago

Thanks for the answer! It works. But after changing the version I am encountering many more serious problems (with not definded notify function and probably something else). I think it will take some time to upgrade and correct all my code and I will have to schedule this for the future. Btw. is there any migration document available?

Temporarly I want to find something that I can do with 1.8. Could you tell me what is the reason it does not work in Internet Explorer with Tempo 1.8? Is there something I can do with to make this work? Will Twigkit still support and maintain Tempo 1.8 or I really should upgrade as soon as posible?

mrolafsson commented 11 years ago

This is all documented on http://tempojs.com/ - but no there's not an upgrade guide.

template.errors(errorHandler) Tempo will attempt to deal with errors and failures silently but you can pass in your own handler for exceptions:

errorHandler A function which will be called with the error object from the try/catch block. Tempo.prepare('list').errors(function (err) { console.log('Whoa! something happened!'); console.log(err); }).render(data);