HTML 富文字編輯器外掛 CKEditor
阿新 • • 發佈:2019-02-10
一、使用
1、將ckeditor整個資料夾放到網站資源目錄下。2、 在要新增ckeditor的網頁上加入ckeditor.js。
<!DOCTYPE html> <html lang="en"> <head> <!--<script src="ckeditor/ckeditor.js"></script>--> <script src="resourse/ckeditor/ckeditor.js"></script> <meta charset="UTF-8"> <title>Title</title> </head>
3、在要轉換成富文字的textarea下方編寫js:CKEDITOR.replace('textarea的name')
<!DOCTYPE html> <html lang="en"> <head> <!--<script src="ckeditor/ckeditor.js"></script>--> <script src="resourse/ckeditor/ckeditor.js"></script> <meta charset="UTF-8"> <title>Title</title> </head> <body> <textarea rows="30" cols="50" name="editor01">請輸入.</textarea> <script type="text/javascript">CKEDITOR.replace('editor01');</script> </body> </html>