ylylan 2009-12-11 15:15
浏览 203
已采纳

ext2.0使用FCKeditor报异常

var sFCKeditorToolbar = 'Default'; var sFCKeditorBasePath =" <%=request.getContextPath()%>"+ '/fckeditor/'; var sFCKeditorBaseHref = 'http://localhost:8080/test/'; var sFCKeditorSkinPath = " <%=request.getContextPath()%>"+'/fckeditor/editor/skins/office2003/'; Ext.form.FCKeditor = function(config){ Ext.form.FCKeditor.superclass.constructor.call(this, config); this.FCKid=0; this.MyisLoaded=false; this.MyValue=''; }; Ext.extend(Ext.form.FCKeditor, Ext.form.TextArea, { onRender : function(ct, position){ if(!this.el){ this.defaultAutoCreate = { tag: "textarea", style:"width:100px;height:60px;", autocomplete: "off" }; } Ext.form.TextArea.superclass.onRender.call(this, ct, position); if(this.grow){ this.textSizeEl = Ext.DomHelper.append(document.body, { tag: "pre", cls: "x-form-grow-sizer" }); if(this.preventScrollbars){ this.el.setStyle("overflow", "hidden"); } this.el.setHeight(this.growMin); } if (this.FCKid==0) this.FCKid=get_FCKeditor_id_value() setTimeout("loadFCKeditor('"+this.name+"');",100); }, setValue : function(value){ this.MyValue=value; if (this.FCKid==0) this.FCKid=get_FCKeditor_id_value() FCKeditorSetValue(this.FCKid,this.name,value) Ext.form.TextArea.superclass.setValue.apply(this,[value]); }, getValue : function(){ if (this.MyisLoaded){ value=FCKeditorGetValue(this.name); Ext.form.TextArea.superclass.setValue.apply(this,[value]); return Ext.form.TextArea.superclass.getValue(this); }else{ return this.MyValue; } }, getRawValue : function(){ if (this.MyisLoaded){ value=FCKeditorGetValue(this.name); Ext.form.TextArea.superclass.setRawValue.apply(this,[value]); return Ext.form.TextArea.superclass.getRawValue(this); }else{ return this.MyValue; } } }); Ext.reg('fckeditor', Ext.form.FCKeditor); function loadFCKeditor(element){ //if (typeof(FCKeditorAPI)!="undefined"){ oFCKeditor = new FCKeditor(element);//************************就是这里报错********************** oFCKeditor.ToolbarSet = sFCKeditorToolbar ; oFCKeditor.Config['SkinPath'] = sFCKeditorSkinPath ; oFCKeditor.Config['PreloadImages'] = sFCKeditorSkinPath + 'images/toolbar.start.gif' + ';' + sFCKeditorSkinPath + 'images/toolbar.end.gif' + ';' + sFCKeditorSkinPath + 'images/toolbar.bg.gif' + ';' + sFCKeditorSkinPath + 'images/toolbar.buttonarrow.gif' ; oFCKeditor.BasePath = sFCKeditorBasePath ; oFCKeditor.Config['BaseHref'] = sFCKeditorBaseHref ; oFCKeditor.Height = 100 ; oFCKeditor.ReplaceTextarea() ; //} } function FCKeditor_OnComplete(editorInstance){ Ext.getCmp(editorInstance.Name).MyisLoaded=true; editorInstance.Events.AttachEvent('OnStatusChange', function(){ Ext.getCmp(editorInstance.Name).setValue(); }) } var FCKeditor_value=new Array(); function FCKeditorSetValue(id,name,value){ if ((id!=undefined)&&(name!=undefined)){ if (value!=undefined) FCKeditor_value[id]=value; else if (FCKeditor_value[id]==undefined) FCKeditor_value[id]=''; var oEditor = FCKeditorAPI.GetInstance(name) ; if(oEditor!=undefined) oEditor.SetData(FCKeditor_value[id]) } } function FCKeditorGetValue(name){ if ((id!=undefined)&&(name!=undefined)){ var oEditor = FCKeditorAPI.GetInstance(name) ; data=''; if(oEditor!=undefined) data=oEditor.GetData() return data; } } var FCKeditor_id_value; function get_FCKeditor_id_value(){ if (!FCKeditor_id_value){ FCKeditor_id_value=0; } FCKeditor_id_value=FCKeditor_id_value+1; return FCKeditor_id_value; } 报错: FCKeditor is not defined, js我也加了啊: <script type="text/javascript" src="fckeditor/editor/fckeditor.js">
  • 写回答

1条回答 默认 最新

  • zhoujuan520 2009-12-11 22:22
    关注

    [quote]FCKeditor is not defined,
    js我也加了啊: [/quote]

    路径正确与否? 试着下载这个js看能下载到不

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥20 测距传感器数据手册i2c