1
<p id="[email protected]">
<script type="text/javascript">
$(document).ready(function() {
GetSelfText('@item.ThreadID');
});
</script>
</p>
function GetSelfText(thingId) {
$.getJSON("http://www.reddit.com/r/playitforward/comments/" + thingId + "/.json?jsonp=?",
{ id: thingId },
function (data) {
$("#selfText-" + thingId).html(data[0].data.children[0].data.selftext_html)
})
}
現在,它對html進行編碼並將html包裝在引號中。我需要它是原始的HTML。我也試圖使用JQuery Expander,它不適用於插入Ajax的內容。如何在ASP.NET MVC中使用javascript作爲原始html插入內容
所以我需要解決2個問題。將返回的數據作爲原始html插入,並使擴展器插件與插入Ajax的內容一起工作。
謝謝你,它的工作原理。現在我可以嘗試修復擴展器。 –
@sevenalive,很高興它的工作..對於擴展你可能想更詳細地描述問題,並張貼相關的代碼以及(*也許一個新的問題更好*) –