怎麼調用ckeditor呢,下面小編來給大家總結一處利用php 調用ckeditor編輯器與js調用ckeditor的方法吧,其它指令碼調用方法大致一樣了。
PHP調用FCKeditor
將FCKeditor放在網站根目錄
在PHP檔案裡面,包含/FCKeditor/ckeditor/" target="_blank">fckeditor.php檔案
在網頁中需要放置該編輯器的地方插入下面代碼即可調用:
| 代碼如下 |
複製代碼 |
//包含fckeditor類 include("fckeditor/fckeditor.php") ; //建立一個FCKeditor,表單名稱為 jzleditor $oFCKeditor = new FCKeditor("jzleditor"); //設定編輯器路徑 $oFCKeditor->BasePath = "fckeditor/"; $oFCKeditor->ToolbarSet = "Default";//工具按鈕 $oFCKeditor->Value =$cont; //;設定初始內容 $oFCKeditor->Width="100%"; //設定它的寬度 $oFCKeditor->Height="550px"; //設定它的高度 $oFCKeditor->Create(); ?> |
輸入內容,提交後,在處理的檔案中通過$_POST["jzleditor"]來取得輸入的內容
js調用FCKeditor
CKEDITOR的使用很簡單,先download CKEDITOR 3.6.1(預設是PHP版的),然後在調用頁面的head中,寫下如下兩段js:
注意:這裡的content是的名稱,如下所示:</p><p><textarea name="content">ddd如果是3.6.2版本,該語句可能要寫成:
ddd
版本差異造成的問題,請大家在運行時注意這個問題。
在下一個頁面根據name值content擷取相應的值
http://www.bkjia.com/PHPjc/633142.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/633142.htmlTechArticle怎麼調用ckeditor呢,下面小編來給大家總結一處利用php 調用ckeditor編輯器與js調用ckeditor的方法吧,其它指令碼調用方法大致一樣了。 PHP調用...