【发布时间】:2016-04-11 01:07:54
【问题描述】:
我使用的是 Summernote 所见即所得编辑器,我在编辑器中编写了一些内容,然后将其保存在 Mysql DB 中,现在当我使用 php 从 DB 检索内容并将其回显到 Summernote 时,编辑器显示 html 代码而不是如我们在所见即所得上看到的格式化内容,请为此提供一些解决方案。 我的代码:
<textarea id="summernote" class="form-control" placeholder="Article" name="article_content"><?php echo $article_content; ?></textarea>
<script src="summernote-0.7.0-dist/dist/summernote.min.js"></script>
<script>
$(document).ready(function() {
$('#summernote').summernote({
height: "300px"
});
});
var postForm = function() {
var content = $('textarea[name="article_content"]').html($('#summernote').code());
}
</script>
【问题讨论】:
标签: php html mysql summernote