我正在使用ASP.NET MVC開發 Web 應用程式。我想將 MsSQL 資料庫中
<div class="form-group">
<label class="control-label">Content</label>
<div id="summernote"></div>
</div>
function FUNCTION_GetPostDetailByPostID(e) {
$.ajax({
url: "/Post/GetPostDetailByPostID?postId=" e,
type: "get",
success: function (e) {
$("#inputPostID").val(e.ID);
$("#inputTitle").val(e.Title);
$("#inputSlug").val(e.Slug);
$("#imgPost").attr("src", e.ImageUrl);
$("#inputShortDescription").val(e.ShortDescription);
$("#selectCategory").val(e.CategoryID);
$("#inputDate")[0].value = e.ModifiedOnString;
$("#inputIsActive")[0].checked = e.IsActive;
/* The line below doesn't work, but there is no error warning in the console. */
$("#summernote").code(e.PostContent);
}
});
}
uj5u.com熱心網友回復:
您可能正在使用Summernote的更新版本。要將格式化的資料從資料庫列印到 summernote 容器,請$("#summernote").code(e.PostContent);按如下方式更新該行:
$("#summernote").summernote("code", e.PostContent);
示例應用程式在Basic API 中可用,而不是在Insertion API 中可用。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/386023.html
標籤:javascript 阿贾克斯 所见即所得
