summernote从Mysql DB中检索后显示html代码

时间:2016-01-06 19:56:24

标签: php html mysql summernote

我使用summernote wyswyg编辑器,我在编辑器中写了一些内容然后我将它保存在Mysql DB中,现在当我使用php从DB检索内容并在summernote上回显时,编辑器显示html代码而不是我们在wyswyg上看到的格式化内容,请给我一些解决方案。 我的代码:



 <textarea id="summernote" class="form-control" placeholder="Article" name="article_content"><?php echo $article_content; ?></textarea>
&#13;
&#13;
&#13;

&#13;
&#13;
    <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>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

ideea很好,问题在于你如何获取数据。

您应该使用py获取数据,然后在div /文本区域中回显

相关问题