zoukankan      html  css  js  c++  java
  • 关于ueditor的使用心得

    http://blog.csdn.net/baronyang/article/details/45640181

    1、取编辑器内的内容:

    [javascript] view plain copy
    1. <span style="font-size:14px;">ue= UE.getEditor('editor');   
    2. content=ue.getContent();//注:这里取的并非显示的内容,而是源代码,即已转义的html字符串,可以保存到数据库中</span>  

    2、取编辑器内的纯文本内容

    [javascript] view plain copy
    1. <span style="font-size:14px;">noticetext=ue.getContentTxt();//取纯文件的目的是用来显示公告栏简介</span>  

    3、php方法保存编辑器的内容和简介

    1. <span style="font-size:14px;">$data['notice_desc']=mb_substr($this->_post('noticetext'),0,300,'utf-8');//对传来的纯文本截取前300个字  
    2. $data['notice_content']=$this->_post('content');                         //传来的编辑器内容,无需再转义</span>  


    4、如何将内容显示到编辑内

    1. <script id="editor" type="text/plain" style="992px;height:auto;">  
    2.  <?php   
    3.       echo htmlspecialchars_decode($outpara['notice_content']);//需要再转义回html  
    4.    ?>  
    5. </script>    


    5、如何只读显示编辑器,有时不希望公告栏被编辑

    [javascript] view plain copy
    1. <script type="text/javascript">  
    2.     var ue=null;  
    3.     $(function(){   
    4.       ue= UE.getEditor('editor');  
    5.       ue.addListener('ready',function(){  
    6.           ue.setDisabled();  
    7.       });  
    8.     });     
    9. </script>  




  • 相关阅读:
    C# Enum设计和使用的相关技巧
    Bat文件编写
    js cookie操作
    Android use custom html tag in TextView
    Charset , Encoding
    Android View (transship)
    Android About ContentProvider
    android,create text file in sdcard
    Eclipse Shortcuts
    Common Terminology
  • 原文地址:https://www.cnblogs.com/wdcwy/p/7477613.html
Copyright © 2011-2022 走看看