84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
artTemplate template engine, the data obtained from the background is html code, whether it is rendered to the page or label, how to solve it
光阴似箭催人老,日月如移越少年。
You can use jQuery to replace tags
<script> var data="<font color='red'>测试数据</font>";//带有html标签的测试数据 $('#p1').html(data);//通过html()方法将数据输出到p中 </script>
You try it! Dude, don’t forget to introduce jQueryOf course, native js is also possible
It’s very simple, you create a new DOM node <p id="content"></p>, then var a variable equal to this code, assign this variable to the DOM node, use jQuery method As mentioned above, the native method is <script>
var str = "那段代码"; document.getElementById("content").innerHTML(str);
</script>
// [3]. Use templates to generate HTML. The output is escaped by default. If not escaped, use {{#value}}
I happened to encounter this problem when I was using artTemplate recently.
Use {{@html}} for original text output
{{@html}}
There are risks, use with caution.
Official tutorial: https://aui.github.io/art-tem...Original text output
You can use jQuery to replace tags
You try it! Dude, don’t forget to introduce jQuery
Of course, native js is also possible
It’s very simple, you create a new DOM node <p id="content"></p>, then var a variable equal to this code, assign this variable to the DOM node, use jQuery method As mentioned above, the native method is
<script>
</script>
// [3]. Use templates to generate HTML. The output is escaped by default. If not escaped, use {{#value}}
I happened to encounter this problem when I was using artTemplate recently.
Use
{{@html}}
for original text outputThere are risks, use with caution.
Official tutorial: https://aui.github.io/art-tem...Original text output