2012-08-01 70 views
1

我必须从ajax查询呈现以下html标记。问题是cfml将任何以#作为前缀的字符串作为标识符。所以我得到一个错误。如何在cfoutput中添加#号?

<cfoutput> 
       <table style="display:none;" width="100%" border="1" cellpadding="2" cellspacing="0"> 
        <tr> 
         <td width="43%" bgcolor="#649DCA"><strong>Class</strong></td> 
         <td width="20%" bgcolor="#649DCA"><strong>Site</strong></td> 
         <td width="47%" bgcolor="#649DCA"><strong>Date/Time</strong></td> 
        </tr> 
    </cfoutput> 
+0

我很惊讶你没有找到任何搜索,因为这是一个非常普遍的问题。首先导致[coldfusion#符号输出]的结果(http://www.adobe.com/support/coldfusion/getting_started/using_poundsigns_quotat/using_poundsigns_quotat04.html) – Leigh 2012-08-01 14:25:48

+0

yes did not find。我在 doc也看过 – Steve 2012-08-01 14:36:22

+1

我只能假设有你遗漏的代码。您发布的代码不包含任何ColdFusion变量,因此没有理由将其包装在CFOUTPUT标签中。 – 2012-08-01 14:57:38

回答

10

你只需要加倍你的#。

<td width="43%" bgcolor="##649DCA"><strong>Class</strong></td> 

就个人而言,我可能会只使用CSS和样式表分开。

+0

是的,但我用ajax动态地使用它 – Steve 2012-08-01 14:37:05