Baidu Editor ueditor use
Introducing steps:
- ueditor into the appropriate directory
For example, \ blog \ Public \ admin
2, page head added js
<script type="text/javascript" charset="utf-8" src="ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="ueditor.all.min.js"> </script>
<-! Recommended to manually load the language, ie avoid at sometimes because language fails to load and cause the editor failed to load ->
<! - here loaded language file overrides the type of language you add in the configuration project, for example, you configure in a project in English, Chinese load here, and that is the last Chinese ->
<script type="text/javascript" charset="utf-8" src="lang/zh-cn/zh-cn.js"></script>
3, the definition of multi-line text box
<textarea name="content" id="content" class="common-textarea" cols="30" style="width: 98%;" rows="10"></textarea>
4, the editor // instantiate
// recommended to use factory methods to create and references getEditor editor instance, if the reference to the relevant instances editor at a certain closure, direct call UE.getEditor ( 'editor') will be able to get
<script>
var = ue UE.getEditor ( ' content ');
</script>
Note that steps 3 and getEditor same id () parameters.
other request:
- Custom Menu
Reference: ueditor.config.js
- View and upload files path settings
参考config.json
php/config.json中 imagePathFormat
"ImageUrlPrefix": "http://img1.blog.month4.com", / * image access path prefix * /
"ImagePathFormat": "/ Public / ueditor / php / upload / image / {yyyy} {mm} {dd} / {time} {rand: 6}", / * upload save path can customize the path and file name format*/