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學習者快速成長!