2012-08-01 69 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