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 在若依框架下实现人脸识别
  • ¥15 网络科学导论,网络控制
  • ¥100 安卓tv程序连接SQLSERVER2008问题
  • ¥15 利用Sentinel-2和Landsat8做一个水库的长时序NDVI的对比,为什么Snetinel-2计算的结果最小值特别小,而Lansat8就很平均
  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同