【问题标题】:how to output something like <this is my word="word" value="#abcg#"> using cfoutput coldfusion如何使用 cfoutput Coldfusion 输出类似 <this is my word="word" value="#abcg#"> 的内容
【发布时间】:2014-06-04 19:09:16
【问题描述】:

如何输出类似使用 cfoutput 标签的东西。

     <cfoutput>
         <this is my word="word" value="#abcg#">
     </cfoutput>

当我使用单引号时,这不会给我任何东西,它会像单引号一样打印它

     <cfoutput>
        <'this is my word="word" value="#abcg#"'>
     </cfoutput>

结果是:

      <'this is my word="word" value="#abcg#"'>

我怎样才能得到只是

    <this is my word="word" value="#abcg#">

感谢您的帮助

【问题讨论】:

  • 尖括号是您尝试打印的字符串的一部分吗?
  • 大多数浏览器会看到“”并将它们视为带有未知标签的 HTML 容器。
  • 是的,带尖括号
  • 带有
     标签的输出不同,它在打印左尖括号后会换行
  • 你想在屏幕上显示#abcg#,还是#abcg#的值?

标签: coldfusion cfoutput


【解决方案1】:

您可以使用以下内容来逃避浏览器尝试将其呈现为 HTML 标记

<cfoutput>
    &lt;this is my word="word" value="#abcg#"&gt;
 </cfoutput>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多