-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
I am currently trying to include an underscore template using ace.
I need to give 1. an id to the script and it should not be escaped...
This is the template:
<script type="text/template" id="result-row">
{% _.each(results, function(result,key,arr) { %}
<tr onclick="getBook( {%= result.id %} )">
<td>{%= result.id %}</td>
<td>{%= result.title %}</td>
<td>{%= result.author%}</td>
<td>{%= result.year%}</td>
</tr>
{% }); %}
</script>The script tag
If I use the script tag, I can assign a id attribute, like this:
script id="result-row" type="text/javascript"
But this results in the "<" and ">" beeing escaped and tags added like this:
<script id="result-row" type="text/javascript"><{%>_.each(results, function(result,key,arr) { %}<<tr onclick=""getBook( {%= result.id %} )">"><<td>{%=>result.id %}</td></<td>{%=><<td>{%=>result.title %}</td></<td>{%=><<td>{%=>result.author%}</td></<td>{%=><<td>{%=>result.year%}</td></<td>{%=></<tr><</tr>></</tr>></{%><{%>}); %}</{%></script>
Using the = javascript syntax
In this case all is fine. Exept: I am not able to assign an id to the javascript element.
Beeig able to add attributes to = javascript would actually fix this
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels