I'm facing issue with greater than and less than symbols, i have created template for table and generate
with the value of <less than. But it was considered as a new tag not a text. Here is my code sample,
while (i < 10) {htmlStr += "<td > <less than </td>";i++;}templates["obj"] = htmlStr + "</tr>";$.templates(templates);$("#TemplateData").append($.render["obj"]([{},{}]));
I'm facing issue with greater than and less than symbols, i have created template for table and generate with the value of <less than. But it was considered as a new tag not a text. Here is my code sample,
BorisMoore
commented
7 years ago
BorisMoore
commented
7 years ago
BorisMoore
commented
7 years ago
- © Githubissues.
- Githubissues is a development platform for aggregating issues.
while (i < 10) {
htmlStr += "<td > <less than </td>";
i++;
}
templates["obj"] = htmlStr + "</tr>";
$.templates(templates);
$("#TemplateData").append($.render["obj"]([{},{}]));
JS Fiddle: https://jsfiddle.net/z8fqs1yb/7/
Is it possible to display a value with < or > symbols ?
Your problem is not with JsRender - which is rendering what you ask it to. You can rewrite as:
The problem is simply with inserting invalid HTML, on the second line. The browser will try to guess what you mean.
You probably want to write:
https://developer.mozilla.org/en-US/docs/Glossary/Entity https://www.w3schools.com/html/html_entities.asp
You can also use
http://www.jsviews.com/#htmltag
You can also do
https://jsfiddle.net/BorisMoore/z8fqs1yb/8/
I think this can be closed...