我在數據庫中有<label class='ash'>Comment Removed</label>
。如何從jQuery中的字符串獲取原始html?
當我在網格上顯示這個。我得到這個頁面上:
<label class='ash'>Removed</label>
其實我應該得到的灰色刪除顏色
我怎樣才能將它轉換爲HTML類似的我在MVC 3 Razor視圖嗎?
@Html.Raw(HttpUtility.HtmlDecode(comment.txt)) works fine
我使用jQuery 1.6的MVC 3
我想:
$("<label class='ash'>Comment Removed</label>").html()
unescape($(txt)).html()
可能很簡單,但無法弄清楚
[該解決方案(http://stackoverflow.com/questions/1219860/javascript-jquery -html-encoding)可能會幫助 – 2011-05-13 22:44:10