2014-08-27 2 views
5

내가 CKEdtior 상당히 새로운 오전 그냥 내가 일하고 있어요이 웹 사이트에 설치 한 버전이 페이지에 4.4.4CKEditor 사용자 정의 등록하지 않음 작업 및 가져 오기 오류

편집기 자체가로드,하지만 언어 나 uiColor 같은 사용자 지정 속성이 작동하고, 또는 속성없이, 나는 오류가 계속되지 않습니다는 샘플에서 작동하기 때문에

Uncaught TypeError: Cannot read property 'getEditor' of undefined 

내가 뭔가를 잘못하고 있어요 알고있다. 도움이된다면 코드는 Smarty 템플릿의 일부입니다. 밑줄이없는 ID를 사용해 보았습니다. 물론 IE, FF 및 Chrome에 오류가 표시되어 여러 브라우저에서 확인했습니다. 코드의

관련 비트 : 당신은 관련 <textarea> 코드에있는 장소 전에 CKEDITOR.replace()를 호출 할 수 없습니다

<script type="text/javascript" src="ckeditor/ckeditor.js"></script> 
<script type="text/javascript"> 
    {literal} 
    CKEDITOR.replace('show_description', 
    { 
     language: 'he' 
    }); 
    {/literal} 
</script> 

<textarea name="show_description" id="show_description" class="ckeditor"></textarea> 

답변

16

. 당신은 replace by code sample에서 볼 수 있습니다

<textarea cols="80" id="editor1" name="editor1" rows="10">content</textarea> 
<script> 

    // This call can be placed at any point after the 
    // <textarea>, or inside a <head><script> in a 
    // window.onload event handler. 

    // Replace the <textarea id="editor"> with an CKEditor 
    // instance, using default configurations. 

    CKEDITOR.replace('editor1'); 

</script> 
3

당신이 CKEDITOR.replace에서 PARAM ('yourclass')로 클래스를 사용하는 경우; 텍스트 영역을 편집기로 대체하지만 동일한 오류가 발생합니다.

-1

settimeout()이라는 함수를 작성할 수 있습니다.

예 :

setTimeout(function(){CKEDITOR.replace('id-textarea')},time); 
+0

이름이 잘못, 그것은'setTimeout'입니다. https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout을 참조하십시오. – Stephan

관련 문제