cheditor5 표만들기 등등

cheditor5 표만들기 등등

QA

cheditor5 표만들기 등등

본문

cheditor5에서 표만들기 및 사진 등 버튼을 누르면

cheditor.js 에 오류가 표기되는데

iframe.contentWindow.init.call(self, iframe, popupAttr.argv || null); 이부분이 오류가 납니다.

 

콘솔창에서는

Uncaught TypeError: Cannot read properties of undefined (reading 'call')
    at HTMLIFrameElement.popWinResizeHeight (cheditor.js:4664:43)

이런오류가 발생합니다

어떤 이유이며 해결방법이 있을까요?

이 질문에 댓글 쓰기 :

답변 2

cheditor.js파일에서 contentWindow 속성이 정의 되지 않아서 발생 하는 오류 인 것으로 알고 있습니다.

그누보드 최신버전이 아니실 경우 최신버전의 cheditor.js 파일을 교체해보세요..

 

교체후에도 같은 증상일 경우 아래 cheditor.js 파일에서 iframe.contentWindow.init 함수를 찾아서 아래와 같이 수정후 테스트를 해보시면 될 것 같습니다.


if (typeof iframe.contentWindow.init === 'function') {
  iframe.contentWindow.init.call(self, iframe, popupAttr.argv || null);
} else {
  // init 함수가 없는 경우 예외 처리
  console.error('init function is not defined in cheditor.js');
}

그누보드 5.5.8.3 버전을 이용중입니다.

말씀해주신대로 5.5.8.3.1 의 파일로 수정해보았습니다만 똑같은 오류가 발생합니다

같은 파일이시라고하신다면 cheditor.js의 4664부분인데  

iframe.contentWindow.init 이걸 쓰는부분이 저기뿐입니다... 방법이없을까요?

cheditor.js 가 다른 라이브러리 와 충돌이 생겨서 그럴수 도 있지만 특별히 커스텀을 하지 않는 이상 문제가 없을 것이고요. 저도 그누5.5.8.3을 사용하지만 위와 같은 현상이 없어서 딱히 뭐라 답변을 드리기는 어렵지만 아래와 같이 해보세요


if (typeof iframe.contentWindow.init === 'function') {
  iframe.contentWindow.init.call(self, iframe, popupAttr.argv || null);
} else if (typeof iframe.contentWindow.init !== 'undefined') {
  // init 함수가 정의되었지만 function이 아닌 경우 예외 처리
  console.error('init is not a function in cheditor.js');
} else {
  // init 함수가 정의되지 않은 경우 예외 처리
  console.error('init function is not defined in cheditor.js');
}

위와 같이 해도 안되신다면 다른 에디터를 사용해 보시는게 어떨지요

답변을 작성하시기 전에 로그인 해주세요.
전체 129,112 | RSS
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT