一、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()”>