CKeditor里面写内容怎么获取

WBOY
发布: 2016-06-23 13:46:04
原创
892 人浏览过

这个是调用编辑器的代码 error_reporting(0); 
include './ckeditor/ckeditor.php'; //include ckeditor.php
$ckeditor = new CKEditor;

include './ckfinder/ckfinder.php';
$ckeditor->editor('content');
CKFinder::SetupCKEditor($ckeditor, true, true);

?>

我百度用这样的方法: $editor = CKEDITOR.replace("content");
$content=$editor.getData();

但是输出这样的错误 Notice: Use of undefined constant CKEDITOR - assumed 'CKEDITOR' in D:\xampp\htdocs\belong\add.php on line 5

Fatal error: Call to undefined function replace() in D:\xampp\htdocs\belong\add.php on line 5  求指导,,,纯属PHP菜鸟


回复讨论(解决方案)

一直用js 版本的~

这个可以一句代码获取:
http://www.162100.com/162100editor/

我是用JS版的
提交时直接获取textarea的ID

js:
取值:

var text=CKEDITOR.instances.content.getData();
登录后复制

赋值:
CKEDITOR.instances.text1.setData('你好');
登录后复制

用js版的吧,好用些

用js版的吧,好用些


请问js版的如何获取

var text=CKEDITOR.instances.content.getData();

来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!