Skip to content

rife.render.EncodeJs

Erik C. Thauvin edited this page Mar 18, 2023 · 2 revisions

Encodes a template value to JavaScript/ECMAScript.

Usage

<!--v render:rife.render.EncodeJs:valueId/-->
{{v render:rife.render.EncodeJs:valueId/}}

Sample

Template

alert("{{v render:rife.reader.EncodeJs:alert/}}");

Code

template.setAttribute("alert", "It's alright! Everything is /OK/!");

Output

alert("It\'s alright! Everything is \/OK\/!");