分类:JS记事本 发布时间:2017-09-22 11:30:19 阅读: 作者:郑祥景
一、编辑页面:
加载js:
<script type="text/javascript" charset="gbk" src="{{ asset('/ueditor/ueditor.config.js') }}"></script> <script type="text/javascript" charset="gbk" src="{{ asset('/ueditor/ueditor.all.min.js') }}"> </script> <script type="text/javascript" charset="gbk" src="{{ asset('/ueditor/lang/zh-cn/zh-cn.js') }}"></script>
编辑框放置的位置加上:
<script id="editor" type="text/plain" name="content"> {!! $old_input['content'] or '' !!} </script>
启动编辑器:
<script> $(document).ready(function () { //开启编辑器 UE.getEditor('editor') }) </script>
二、展示页面
页面底部加上代码:
<script src="{{ asset('/ueditor/ueditor.parse.min.js') }}"></script> <script type="text/javascript"> window.onload=function(){ uParse('#content', { rootPath: '/ueditor' }); }; </script>
三、两个配置文件:
/ueditor/ueditor.config.js //配置编辑框样式及其他 /ueditor/php/config.json //配置上传文件保存地址等
编辑:郑祥景