Closed fieder closed 12 years ago
The closing {{for}} should be {{/for}}
The same basic issue markup.replace is not a function line 461 on zip downloaded today.
The replace function is hitting a pure number and therefore replace is not defined and the template crashed.
As in the case above, that is likely because you made a mistake matching tags. Check that you have {{foo...}} ... {{/foo}} for any block tags (such as if or for), and {{foo ... tmpl=... /}} for tags using external templates. Also that your HTML is well-formed... If necessary, build up your template step by step to find which construct is leading to the error...
A few strange things happened number disappeared in html. the html was poorly formed as you suggested.
i placed a guard condition on the logic. To get further if(markup.replace) in two places.
I found i was using {{name}} without the : and the whole chunk disappeared.
I also tried a helper for formatting numbers. Could not get that right ended up formatting input rather than work it out.
Is it worth writing a separate Verification of the the template? for developer usability?
Ken Foskey
-------- Original message -------- Subject: Re: [jsrender] fail to compile template {for} (#112) From: Boris Moore reply@reply.github.com To: waratah kfoskey@tpg.com.au CC:
As in the case above, that is likely because you made a mistake matching tags. Check that you have {{foo...}} ... {{/foo}} for any block tags (such as if or for), and {{foo ... tmpl=... /}} for tags using external templates. Also that your HTML is well-formed...
Reply to this email directly or view it on GitHub: https://github.com/BorisMoore/jsrender/issues/112#issuecomment-5877956
Yes at some point both better error handling and some template validation tooling would be very valuable. But the priority is first to get the basic design and features established, and the primary scenarios working. Then we will have an official beta or beta2. Full documentation will be the next thing. Improved error handling after that. And additional developer tools probably after reaching V1.0. So I'm afraid some patience will be required as we move towards those goals... :)
Hi Boris,
The error I get is on line 455, markup.replace() is not a function. Following the code I saw in tmplFn(), line 479 : markup = node[5]. For some reason that node does not contain the markup string but instead a number -the second time it gets into the for loop 466- and that's why markup.replace() fails.
The json structure is very similar to the example of Films you have in the wiki. I'm using jquery-mobile and below's my example