一、PHP調用fckeditor方法。
二、JS調用fckeditor方法。
複製代碼 代碼如下:<?php
require_once(PATH_PRE.”fckeditor.php”); // 包含fckeditor類,
$oFCKeditor = new FCKeditor('content') ; //建立一個fckeditor對象,表單的名稱為content
$oFCKeditor->BasePath=”../fckeditor/”; //編輯器所在目錄
$oFCKeditor->ToolbarSet=”Yiyunnet”; // 預設編輯器工具列有Basic(基本工具) Default(所有工具)Soft(分一欄可以插入圖片視頻 ) Renpeng (可以上傳圖片視頻分為兩欄 ) Full (三欄)
$oFCKeditor->Height='100%'; //高度
$oFCKeditor->Width='100%'; //寬度
$oFCKeditor->Value=”"; //初始值 還可設定以下部分(”=”包含部分),並非必須:
$oFCKeditor->Config['SkinPath'] = ‘../editor/skins/silver/'; // 設定編輯器皮膚共有三種皮膚default
$oFCKeditor->Create(); //在要顯示編緝器的地方輸出變數$myeditor的值就行了
?>
FCKeditor js調用方法一 複製代碼 代碼如下:<script src=”fckeditor/fckeditor.js”></script>
<script type=”text/javascript”>
var oFCKeditor = new FCKeditor( ‘Content' ) ;
oFCKeditor.BasePath = ‘fckeditor/' ;
oFCKeditor.ToolbarSet = ‘Basic' ;
oFCKeditor.Width = ‘100%' ;
oFCKeditor.Height = ‘400′ ;
oFCKeditor.Value = ” ;
oFCKeditor.Create() ;
</script>
FCKeditor js調用方法二 複製代碼 代碼如下:<script src=”fckeditor/fckeditor.js”></script>
<script type=”text/javascript”>
function showFCK(){
var oFCKeditor = new FCKeditor('Content') ;
oFCKeditor.BasePath = ‘fckeditor/' ;
oFCKeditor.ToolbarSet = ‘Basic' ;
oFCKeditor.Width = ‘100%' ;
oFCKeditor.Height = ‘200′ ;
oFCKeditor.Value = ” ;
oFCKeditor.ReplaceTextarea() ;
document.getElementByIdx(”btnShow”).disabled = ‘true';
document.getElementByIdx(”btnShow”).style.display = ‘none';
}
</script>
<textarea name=”Content”></textarea>
<input id=btnShow style=”display:inline” type=button onclick=”showFCK()”>