亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

javascript - artTemplate template engine, the data obtained from the background is how the html code is rendered to the page
大家講道理
大家講道理 2017-07-05 11:03:48
0
4
1566

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

大家講道理
大家講道理

光陰似箭催人老,日月如移越少年。

reply all(4)
僅有的幸福

You can use jQuery to replace tags

<script>
    var data="<font color='red'>測試數(shù)據(jù)</font>";//帶有html標簽的測試數(shù)據(jù)
    $('#p1').html(data);//通過html()方法將數(shù)據(jù)輸出到p中
</script>

You try it! Dude, don’t forget to introduce jQuery
Of course, native js is also possible

Peter_Zhu

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}}

學(xué)霸

I happened to encounter this problem when I was using artTemplate recently.

Use {{@html}} for original text output

There are risks, use with caution.

Official tutorial: https://aui.github.io/art-tem...Original text output

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template