悟生慧

 

ASP.net mvc开发中使用纯html如何创建FCKeditor编辑器的使用

http://www.cnblogs.com/esshs/archive/2008/12/03/1346326.html

FCKeditor下载路径:

http://sourceforge.net/projects/fckeditor/files/FCKeditor/2.6.6/FCKeditor_2.6.6.zip/download?use_mirror=nchc

<script type="text/javascript"> 
window.onload = function() 
{ 
var oFCKeditor = new FCKeditor( 'MyTextarea' ) ; 
oFCKeditor.BasePath = "/FCKeditor/" ; 
oFCKeditor.ReplaceTextarea() ; 
} 
</script> 
<textarea id="MyTextarea" name="MyTextarea">This is <b>the</b> initial value.</textarea>

使用方法:参考

http://www.oklinux.cn/html/developer/php/jq/20070526/26849.html

http://blog.imwebs.com/article.asp?id=322

http://sourceforge.net/projects/fckeditor/files/FCKeditor.Net/ 下载FCKeditor_2.6.7zip

在ASP.net mvc开发中使用纯html如何创建FCKeditor编辑器控件 步骤:

1.在官网下载 FCKeditor_2.6.6.zip

2.解压缩后添加现有项目到webSite目录下

3.使用JavaScript创建

<script type="text/javascript" src="/Scripts/FCKeditor_2.6.6/fckeditor/fckeditor.js">
 if (typeof (FCKeditorAPI) == 'undefined') {
        var FCKeditor = new FCKeditor("KnowBaseContent");        
    } else {
        FCKeditor.ReplaceTextarea();
    }
    FCKeditor.ToolbarSet = "Basic";
    FCKeditor.Height = 400;
    FCKeditor.ReplaceTextarea();
</script>

4. 进入FCKeditor文件夹,编辑 fckconfig.js 文件
修改
var _FileBrowserLanguage = 'php' ; // asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage = 'php' ; // asp | aspx | cfm | lasso | php
改为
var _FileBrowserLanguage = 'aspx' ; // asp | aspx | cfm | lasso | perl | php | py
var _QuickUploadLanguage = 'aspx' ; // asp | aspx | cfm | lasso | php

修改

FCKeditor.BasePath = '/fckeditor/' ;

改为

FCKeditor.BasePath = '/Scripts/FCKeditor_2.6.7/fckeditor/';

修改

FCKConfig.ToolbarSets["Basic"] = [
 ['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About']
] ;

改为

FCKConfig.ToolbarSets["Basic"] = [
 ['Bold', 'Italic', '-', 'OrderedList', 'UnorderedList', '-', 'Link', 'Unlink', '-', 'About'],
 ['Image', 'Table', 'Smiley', 'SpecialChar', 'PageBreak']//'Rule',
]; ------工具栏的

5.http://sourceforge.net/projects/fckeditor/files/FCKeditor.Net/ 下载FCKeditor_2.6.7zip

解压后把FCKeditor.Net_2.6.7\bin\Release\2.0目录下的FredCK.FCKeditorV2.dll添加引用到webSite中

6.config.ascx中的CheckAuthentication()方法返回true

7.在fckconfig.js中修改此变量给工具栏瘦身

FCKConfig.ToolbarSets["Basic"] = [
 ['Bold', 'Italic', '-', 'OrderedList', 'UnorderedList', '-', 'Link', 'Unlink', '-', 'About'],
 ['Image', 'Flash', 'Table', 'Rule', 'Smiley', 'SpecialChar', 'PageBreak']
] ;

链接地址:https://files.cnblogs.com/wuhuisheng/FCKeditor.zip 包括所需dll包

IE9下不支持FCKeditor

fckeditor/editor/js/fckeditorcode_ie.js

找到第38行的这个方法:FCKTools.RegisterDollarFunction 
将原来的
FCKTools.RegisterDollarFunction=function(A){A.$=A.document.getElementById;};
修改方法为:
FCKTools.RegisterDollarFunction=function(A){A.$=function(v){return A.document.getElementById(v);}};

另外如果你的系统是xp,暂时IE9还是不能够用在xp系统上的,微软开发这个为了在win7上面使用的 

posted on 2012-06-11 18:26  悟生慧  阅读(474)  评论(0编辑  收藏  举报

导航