您的位置:首页 > 其它

一个简单的FCKEditor步骤

2014-09-29 13:01 288 查看

第一步:首先打开下载的fckEditor目录_samps下面的default.html

第二部:打开页面查看框架源代码 复制form里面的内容

<form action="../php/sampleposteddata.php" method="post" target="_blank">

<script type="text/javascript">

<!--

// Automatically calculates the editor base path based on the _samples directory.

// This is usefull only for these samples. A real application should use something like this:

// oFCKeditor.BasePath = '/fckeditor/' ; // '/fckeditor/' is the default value.

var sBasePath = document.location.href.substring(0,document.location.href.lastIndexOf('_samples')) ;

var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;

oFCKeditor.BasePath = sBasePath ;

oFCKeditor.Height = 300 ;

oFCKeditor.Value = '<p>This is some <strong>sample text<\/strong>. You are using <a

href="http://www.fckeditor.net/">FCKeditor<\/a>.<\/p>' ;

oFCKeditor.Create() ;

//-->

</script>

<br />

<input type="submit" value="Submit" />

</form>

第三:新建一个html网页,把上面的加进去。

接着

<!-- 导入js文件 -->

<script type="text/javascript" src="fckeditor.js"></script>

第四部:修改form里面的内容:

<form action="" method="post" target="_blank">

<textarea name="content"></textarea>

<script type="text/javascript">

<!--

var oFCKeditor = new FCKeditor( 'content' ) ;//里面的参数一定要和textarea的name名字相同,否则不能替换

oFCKeditor.BasePath = "./" ;//当前editor的目录,必须以“/”结束

oFCKeditor.Height = 300 ;

oFCKeditor.Value = '显示的默认值' ;

//oFCKeditor.Create() ;//创建一个FCKEditor

oFCKeditor.ReplaceTextarea()//替换上面的textarea使其能在网页上用

</script>

<br />

<input type="submit" value="Submit" />

</form>

第五部:完成测试

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐