动易CMS静态页调用FCK编辑器的代码
文章作者:网友投稿 发布时间:2009-10-25 11:25:32 来源:网络
烈火网( LieHuo.Net )教程 最近有用户想实现AJAX写库,前台的文本框想替换成FCK编辑器,现在给出静态页调用FCK的一个参考例子,有兴趣的用户可以参考一下: 以下为引用的内容: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/D
烈火网(LieHuo.Net)教程 最近有用户想实现AJAX写库,前台的文本框想替换成FCK编辑器,现在给出静态页调用FCK的一个参考例子,有兴趣的用户可以参考一下:
以下为引用的内容:
FCKeditor - Sample - LIEHUO.NET//修改为自己的src
window.onload = function()
{
// 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 = "./fckeditor/" ;//这里修改为你网站的fck编辑器文件夹的相对路径
var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
oFCKeditor.BasePath = sBasePath ;
oFCKeditor.ReplaceTextarea() ;
}
function btnclick()
{
var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ;
// Get the editor contents in XHTML.
alert( oEditor.GetXHTML( true ) ) ; // "true" means you want it formatted.获取fck编辑器的值的方法
}
<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>