2010-09-06 43 views
1

我試圖在JSF頁面中插入雅虎天氣小部件。雅虎生成的代碼如下:包含查詢字符串的iframe在JSF中導致問題

<!-- Yahoo! Weather Badge --><iframe allowtransparency="true" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="http://weather.yahoo.com/badge/?id=12753136&u=c&t=trans&l=vertical" height="255px" width="186px"></iframe><!-- Yahoo! Weather Badge --> 

請注意,iframe src包含查詢字符串。當我嘗試運行它,我得到這個錯誤:

Error Traced[line: 42] The reference to entity "u" must end with the ';' delimiter. 

爲什麼試圖解釋查詢字符串的字符作爲一個實體?我如何解決這個問題?

回答

3

你顯然使用XML/XHTML。您需要用&amp;替換所有「普通香草」&號&