html 特殊字符回显 -- xmp、script

如图要求回显特殊转义字符: 常规回显时,转义字符会被解析,导致无法按文本内容原样展示

  

处理方案:

  1、使用html标签xmp(html5中已被废弃,会有隐患,不推荐)

  2、嵌入到<script type="text/html"><script type="text/template">内部,并加上display: block即可

     easyui-table formatter版:(其他版本类似)

    

 

     注意: script 结尾时 " / " 前最好加个 " \ " 转义,避免解析出错,easyui-table formatter方法不加 \ 转义就会异常。实际使用中自行微调。

 

posted @ 2020-06-23 17:48  【云】风过无痕  阅读(575)  评论(0编辑  收藏  举报