html - Mustache.to_html not returning anything -


I have a total (3) templates in my page and this overlay template is third and last one is the first two basically The template is written as well and they work fine. But for some reasons, console.log (html) does not return any of the following:

   & Lt; / Div & gt; {{OverlayTemplate}} & lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; $ (Function () {$ .getJSON ('/ scripts / art.json', function (data) {var overlaytmpl = $ ('# overlayTmpl'). Html (); var html = mustache.HTML_to (overlaytmpl, data) ; Console.log (html); $ ('# overlay'). Html (html);});}); & Lt; / Script & gt;  

** On the first two templates, the console.lag fineens HTML output. I do not know why something hanging on this JSON file has been validated ...

Please help me out of being mad This block of code should have a hex. Does anyone have a magic wand?

This can help you - Change your template like this:

 < Code> & lt; Script id = "overlayment" type = "text / template" & gt; {{#art}} & lt; Div id = "lightbox" & gt; & Lt; Div id = "closebutton" & gt; X & lt; / Div & gt; & Lt; Img src = "/ images / {{title}} .jpg" /> & Lt; / Div & gt; {{/ Art}} & lt; / Script & gt;  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -