プライマリコーディング言語(Visual FoxPro 9)で次のような変数文字列のAJAX送信があります。
AjaxResponse = CREATEOBJECT("Custom")
lcMessage = "<li class='hello'>Hello</li>"
AjaxResponse.AddProperty("Reply", lcMessage)
Response.ContentType = "text/html"
Response.Write(AjaxResponse.Reply)
jQuery関数.ajax()を使用している間、私は成功を作成しました:次のような関数:
$.ajax({
url: 'index?Proc=GetUuserHistory',
dataType: "html",
success: function(data){
$("div#history-text").html('<ul>' + data + '</ul>');
};
});
私の問題は、「div#history-text」に挿入するテキストがフォーマットされておらず、liタグがまだ含まれていることです。運が悪かったので、.textを.prepend、.append、および.htmlに置き換えてみました... Ajaxを使用して受信した後、この文字列をhtml形式に戻す方法はありますか?