Good Javascript Template Engine for Working with JSON

I looked at jTemplates and it is worth a try. Are there other template engines besides jTemplates?

+3
source share
8 answers

I liked the approach JavaScriptMVC Framework Representations , especially because it uses JavaScript as a template language. The structure is now based on jQuery, and you can display the Model directly in the views (the model supports JSON, JSONP, XML, etc.) ..

+4
source

Have you tried pure.js ?

JS- , PURE HTML JS-. .

, .
/ , XSLT ( ... )

+5

jQuery Smarty. http://www.balupton.com/sandbox/jquery-smarty/demo/

- . , , , . .

onchange. , AJAX, "", -)

+1

Yajet - , , , .:-) , . -; jQuery , jQuery, Rhino V8 .

, , , ..

0

2017 JsRender JsViews, jQuery ( jQuery)

JsRender - , , , DOM. Node.js, jQuery.

JsRender JsViews JQuery JQuery Templates JQuery Data Link - .

- JsRender GitHub Readme

: http://www.jsviews.com/

GitHub (JsRender): https://github.com/BorisMoore/jsrender

GitHub (JsViews): https://github.com/BorisMoore/jsviews

0

async-js-templates. , paralell, .

maven.

0

: https://jocapc.imtqy.com/jquery-view-engine/

JSON HTML , .

-, HTML :

<div id="template">
    <h1 id="Name"></h1>
    <label>Description:</label>
    <textarea name="Desc"></textarea>
    <ul>
        <li class="bind-Tags"></li>
    </ul>
</div>

JS-, :

var data = {   Name: "JOVN",
    Desc: "The simplest view engine",
    Tags: ["View engine", "JavaScript", "SPA"]
}

, :

$("div#template").view(data);

:

<div id="template">
    <h1 id="Name">JOVN</h1>
    <label>Description:</label>
    <textarea name="Desc">The simplest view engine</textarea>
    <ul>
        <li class="bind-Tags">View engine</li>
        <li class="bind-Tags">JavaScript</li>
        <li class="bind-Tags">SPA</li>
    </ul>
</div>

The viewer will populate individual fields or replicate array elements in the template.

0
source

Source: https://habr.com/ru/post/1747536/


All Articles