xajax如何获取fckeditor的值
来源:互联网 发布:手机看电影软件 编辑:程序博客网 时间:2024/04/30 23:41
xajax向html页面输出fckeditor是容易的,但是xajax如何获取fckeditor的值?在xajax的wiki上说了,但还是不明白,测试不成功,最后在fckeditor 2.4.3的_samples/html/sample08.html中找到了答案
function GetContents()
{
// Get the editor instance that we want to interact with.
var oEditor = FCKeditorAPI.GetInstance('content1') ;
// Get the editor contents in XHTML.
//alert( oEditor.GetXHTML( true ) ) ; // "true" means you want it formatted.
var a = oEditor.GetXHTML( true );
xajax_show(a);
}
function GetInnerHTML()
{
// Get the editor instance that we want to interact with.
var oEditor = FCKeditorAPI.GetInstance('content1') ;
alert( oEditor.EditorDocument.body.innerHTML ) ;
}
<?php
require_once('./xajax/xajax.inc.php');
$xajax = new xajax();
$xajax->registerFunction('show');
$xajax->registerFunction('load');
$xajax->processRequest();
echo $xajax->getJavascript('./xajax');
//显示编辑器
function show($form) {
$obj = new xajaxResponse();
$obj->alert($form);
return $obj;
}
//根据内容载入编辑器
function load() {
require_once('../../includes/fckeditor/fckeditor.php');
$editor = new fckeditor('content1');
$editor->BasePath = '../../includes/fckeditor/';
$editor->Value = "test";
$content = $editor->createhtml();
$obj = new xajaxResponse();
$obj->assign('content','innerHTML',$content);
return $obj;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<title></title>
<meta name="Description" content="" />
<meta content="" name="Keywords" />
<link rel="stylesheet" rev="stylesheet" href="" type="text/css" media="all" />
<script language="javascript">
<!--
function GetContents()
{
// Get the editor instance that we want to interact with.
var oEditor = FCKeditorAPI.GetInstance('content1') ;
// Get the editor contents in XHTML.
//alert( oEditor.GetXHTML( true ) ) ; // "true" means you want it formatted.
var a = oEditor.GetXHTML( true );
xajax_show(a);
}
function GetInnerHTML()
{
// Get the editor instance that we want to interact with.
var oEditor = FCKeditorAPI.GetInstance('content1') ;
alert( oEditor.EditorDocument.body.innerHTML ) ;
}
//-->
</script>
</head>
<body>
<script language="javascript">
<!--
xajax_load();
//-->
</script>
<form action="" method="post" name="f1" id="f1">
<a href="#" onclick="xajax_load();return false;" title="">载入编辑器</a>
<a href="#" onclick="setTimeout(xajax_show(xajax.getFormValues('f1')),1500);" title="#">获取输入框的值</a>
<a href="#" onclick="GetContents();" title="">获取方式2</a>
<div id="content">
</div>
</form>
</body>
</html>
http://www.corange.cn/archives/2008/10/2081.html
- xajax如何获取fckeditor的值
- 获取FCKeditor的值
- js中获取Fckeditor的值
- Js FCKeditor的值获取和修改
- js中获取Fckeditor的值
- JS获取FckEditor的值 FCK
- JS获取FckEditor的值 FCK
- xAjax 乱码的解决
- 获取FCKeditor的焦点,判断FCKeditor是否为空(取值)
- 通过xajax给fckeditor增加自动保存草稿功能
- 通过xajax给fckeditor增加自动保存草稿功能
- 利用Js获取和修改FCKeditor的值
- 关于在Winform中设置,获取fckeditor 的值
- 如何设定Fckeditor的工具栏
- xAjax的一点点使用心得
- javascript获取FCKeditor内容及Fckeditor的修改
- javascript获取FCKeditor内容及Fckeditor的修改
- FCKeditor的配置使用及JS获取FCKeditor内容
- Groovy探索之MOP 十三 Interceptor 三(1)
- VC中初始化复选框
- Groovy探索之MOP 十三 Interceptor 三(2)
- 在酷热的就业天气寻找几丝凉意
- 十分钟完成的操作系统编写 你信吗?
- xajax如何获取fckeditor的值
- 董栗序:逃跑的老黄牛
- TUE MAY 19,2009
- 备份和压缩指令
- 有一种爱,叫成全
- VisualFC博客关于WTL开发的系列文章索引
- 快速离散余弦变换代码实现(FDCT)
- (转)linux安装飞信
- Win32应用程序中进程间通信方法分析与比较