Closed longgt closed 7 years ago
You should be able to do the analogous trick to what is done in javascript blocks (putting the CDATA open and close (XML) tag in JavaScript comments // xxx
) - so in this scenario you instead use JsRender comment tags wrapping the CDATA tags:
<script type="text/javascript">{{!--<![CDATA[--}} {{if a && b}} c {{/if}} {{!--//]]>--}}</script>
Can you let me know if this works for you? Thanks.
It's work perfectly. Thanks.
Ah good. Thanks. Closing issue...
In template script, if condition have more than 1 (conjunction is &&) and included in JSF page, when JSF page is loaded, an exception will be throw.
JSF does not accept special characters such as && in script tag without CDATA.
In case of adding template script in CDATA, JsView does not render template properly. For example
Here is my temporary solution for now
Encode special characters by using url encode before including it in template script
It'll be quite cool if JsView supports template with content defined in CDATA.