function getAdmNewsContent(newsId){
alert("newsId:"+newsId);
admnewlist.findByNewsId(newsId,{
callback:function(object){
//
setAdmNewsContent(object);
}
})
}
function setAdmNewsContent(object){
alert("object:"+object.newsContent);
var oEditor = FCKeditorAPI.GetInstance("content");
oEditor.InsertHtml(object.newsContent);
}
我靠,FCK整了我一下午了,我插入内容到FCK里面去 但是老是报FCK.EditorWindow为空或不是对象
郁闷!! 各位大哥请教了
alert("newsId:"+newsId);
admnewlist.findByNewsId(newsId,{
callback:function(object){
//
setAdmNewsContent(object);
}
})
}
function setAdmNewsContent(object){
alert("object:"+object.newsContent);
var oEditor = FCKeditorAPI.GetInstance("content");
oEditor.InsertHtml(object.newsContent);
}
我靠,FCK整了我一下午了,我插入内容到FCK里面去 但是老是报FCK.EditorWindow为空或不是对象
郁闷!! 各位大哥请教了
//取fck内容的长度
function GetMessageLength(str)
{
var oEditor = FCKeditorAPI.GetInstance(str) ;
var oDOM = oEditor.EditorDocument ;
var iLength ;
if ( document.all ) // If Internet Explorer.
{
iLength = oDOM.body.innerText.length ;
}
else // If Gecko.
{
var r = oDOM.createRange() ;
r.selectNodeContents( oDOM.body ) ;
iLength = r.toString().length ;
}
// oEditor.InsertHtml('')
return iLength
}
function checkAll()
{
if(confirm('您确认发布么?'))
{
if(GetMessageLength("taskDetail")<1)
{
alert("请输入任务详情!");
return false;
}
else if(GetMessageLength("taskDetail")>1000)
{
alert("你输入任务详情过长!最多1000字");
return false;
}
}
}
</script><textarea id="taskDetail" name="taskDetail"></textarea>
<script type="text/javascript">
var oFCKeditor = new FCKeditor('taskDetail');//传入参数为表单元素(由FCKeditor生成的input或textarea)的name
oFCKeditor.BasePath='<%=request.getContextPath() %>/FCKeditor/';//指定FCKeditor根路径,也就是fckeditor.js所在的路径
oFCKeditor.Width = '100%' ;
oFCKeditor.Height = '400' ;
oFCKeditor.ToolbarSet='None';//指定工具栏
oFCKeditor.Value="";//默认值
oFCKeditor.ReplaceTextarea();
</script>
你看我object那一段都打印出来了
FCK.EditorWindow为空或不是对象。
最好先看看FCK.EditorWindow引用的地方alert下
还有就是在
textarea id="taskDetail" name="taskDetail"></textarea> 下面需要加入
<script type="text/javascript">
var oFCKeditor = new FCKeditor('taskDetail');//传入参数为表单元素(由FCKeditor生成的input或textarea)的name
oFCKeditor.BasePath='<%=request.getContextPath() %>/FCKeditor/';//指定FCKeditor根路径,也就是fckeditor.js所在的路径
oFCKeditor.Width = '100%' ;
oFCKeditor.Height = '400' ;
oFCKeditor.ToolbarSet='None';//指定工具栏
oFCKeditor.Value="";//默认值
oFCKeditor.ReplaceTextarea();
</script>
自定义,var oFCKeditor = new FCKeditor('taskDetail');//你要把表单数据放入FCKeditor中,另外一个就是如果你确定FCKeditor里面有数据那你检查下你获取表单数据的代码是否有问题