ホームページ  >  記事  >  バックエンド開発  >  CKeditor里面写内容如何获取

CKeditor里面写内容如何获取

WBOY
WBOYオリジナル
2016-06-13 12:53:04841ブラウズ

CKeditor里面写内容怎么获取
这个是调用编辑器的代码 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('你好');
声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。