为什么结果都是html标签直接显示出来?怎么整?

ajax返回json数据中包括html标签,使用mustache插入到模块中,结果都是html标签直接显示出来。试过先将html转义,但没有作用。求解决方法。

ITMISS
浏览 213回答 1
1回答

牛魔王的故事

mustache.js does escape all values when using the standard double mustache syntax. Characters which will be escaped: & \ " < >. To disable escaping, simply use triple mustaches like { { {unescaped_variable} } }.Example: Using { {variable} } inside a template for 5 > 2 will result in 5 &gt; 2, where as the usage of { { {variable} } } will result in 5 > 2.我觉得你要看下文档才行。(上面为&nbsp;https://github.com/janl/mustache.js&nbsp;中摘抄)简单来说 {{{}}} 可以满足你的要求
打开App,查看更多内容
随时随地看视频慕课网APP