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看能下载到不

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

报告相同问题?

悬赏问题

  • ¥20 matlab yalmip kkt 双层优化问题
  • ¥15 如何在3D高斯飞溅的渲染的场景中获得一个可控的旋转物体
  • ¥88 实在没有想法,需要个思路
  • ¥15 MATLAB报错输入参数太多
  • ¥15 python中合并修改日期相同的CSV文件并按照修改日期的名字命名文件
  • ¥15 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题