我发起了一个AJAX调用,获得了一个包含文本的JSON对象中的字符串,格式如下:
我使用这个字符串来填充我的网页上的一个 div,使其呈现如下形式:
然而,当用该文本填充div时,我得到了完全相同的字符串,这意味着
如果有任何区别,我正在使用Angular来获取数据并填充div。
Your girl was in Berkeley with a communist reader. <br> Mine was entombed within boombox and walkman. <br> I was a hoarder, but girl, that was back then. <br> The gloves are off, the wisdom teeth are out. <br> What you on about? <br> I can feel it in my bones. <br> I can feel it in my bones. <br> I'm stronger now, I'm ready for the house. <br> Such a modest mouse. <br> I can't do this alone.
我使用这个字符串来填充我的网页上的一个 div,使其呈现如下形式:
<div class="lyrics-container>{{ the text in the JSON string }} </div>
然而,当用该文本填充div时,我得到了完全相同的字符串,这意味着
<br>
显示为文本。我希望它们能够实际执行其功能并换行。是否有一种方式可以强制浏览器解释字符串中的HTML标签?如果有任何区别,我正在使用Angular来获取数据并填充div。
>
之前。 - Paul