zoukankan      html  css  js  c++  java
  • js / jquery 获取和设置 FCK Editor 的值

      开发中遇到 通过 $("#content").val(); 或者 document.getElementById("content"); 并不能获取到 id 为 content的值

       $("#content").val(--赋值的信息--); 也不能为 id 为 content 赋值;

      页面代码:

      

          <tr>
                   <td class="p12">内容:</td>
                   <td colspan="3">
                     <fck:editor id="content" basePath="${ctx}/scripts/fckeditor/" skinPath="skins/office2003/">                                                 
               </fck:editor> </td> </tr>

      js 获取值的方法:

       

            var oEditor = FCKeditorAPI.GetInstance('content');//content为fck实例的id
            var content = oEditor.GetXHTML(true);

      

      赋值的代码:

            var oEditor = FCKeditorAPI.GetInstance("content") ;  
            oEditor.SetHTML(--赋予的值--) ;  

               就这么愉快的解决了~    

  • 相关阅读:
    vs中无法找到头文件
    c++ vector 用法
    c++ queue 用法
    c++ 中 毫秒级时间获取
    vs2013 boost signals
    vs2013环境下boost配置
    C++ static 用法
    fopen()和fclose()
    删除字符串尾的回车符
    WaitForSingleObject()
  • 原文地址:https://www.cnblogs.com/linnuo/p/6923074.html
Copyright © 2011-2022 走看看