Closed puppetmaster3 closed 7 years ago
JsRender can run on the server. It renders to string, and does not need jQuery.
But JsViews inserts content in the DOM, and uses jQuery, so it does not make sense to run it on the server. It runs in the browser and provides dynamic data-driven UI.
JsViews can nevertheless be installed using NPM. This is a recommended install method even for jQuery plugins that do not run on the server. See http://plugins.jquery.com/
You can create an app which uses JsRender on the server to render pages, and then uses JsViews in the browser to provide dynamic interactivity (e.g. a single page app) using the same templates. See the following links and docs:
http://www.jsviews.com/#node/server-browser (See JsRender on the server, JsRender or JsViews in the browser...)
Examples of this are available here: https://github.com/BorisMoore/jsrender-node-starter#demo-pages
It's clear, thx. I assume I can render array/JSON in JsRender.
You can render JavaScript objects or arrays (or hierarchies of...).
I am looking here: https://www.npmjs.com/package/jsviews jsrender runs on node (not just browser).
Does jsview work in node/serverside?