2014-10-30 120 views
1

我使用的是標準包。爲什麼不顯示ckeditor?

有JS代碼與名稱文本

<script type="text/javascript"> 
       CKEDITOR.replace('text', { 
        toolbar: [ 
         { name: 'document', items: [ 'Source', '-', 'NewPage', 'Preview', '-', 'Templates' ] }, // Defines toolbar group with name (used to create voice label) and items in 3 subgroups. 
         [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ],   // Defines toolbar group without name. 
         '/',                     // Line break - next group will be placed in new line. 
         { name: 'basicstyles', items: [ 'Bold', 'Italic' ] } 
        ] 
       }); 
      </script> 

我得到錯誤控制檯中的Chrome:

Uncaught TypeError: Cannot read property 'options' of undefined 

HTML代碼:

<div class="text"><textarea name="text" placeholder="Основной текст..."></textarea></div> 
+0

你也應該發佈HTML。 – sebnukem 2014-10-30 17:08:14

+0

我通過AJAX獲得HTML – AllenDegrud 2014-10-30 17:12:54

+0

我們需要查看一個示例,因爲很難猜測可能是錯誤的。這個錯誤沒有說什麼。 – Reinmar 2014-10-30 21:59:05

回答

1

在過去也有類似的錯誤與缺失/損壞的語言文件有關。清除瀏覽器緩存並再次加載CKEditor。如果它無助於檢查瀏覽器中的網絡選項卡,並查看語言文件是否正確加載。