웹 응용 프로그램의 UserControl에 CKEditor가 임베드되어 있습니다. 로컬 컴퓨터와 서버에서 CKEditor의 기본 템플릿을로드하면 모두 정상적으로 작동합니다.CKEditor 용 동적 템플릿
데이터베이스 테이블에서 템플릿을 가져 와서 결과를 적절한 JSON 형식으로 변환 한 다음이를 자바 스크립트 파일에 작성하여 CKEDITOR.template_files에 추가합니다.
내가 JS 파일에 생성있어 JS 내용의 예 :
이제CKEDITOR.addTemplates('templateskey',{imagesPath:'',templates:[{title:'LCH - Complaint', image:'', description:'Message Template - Complaints', html:'HtmlContent'}]});
내 문제가 이상로드 해야하는 때문에 우리의 서버가 동적으로 JS이 생성 한에 파일이 차단 얻을 것이다 HTTPS . 이 파일 또는 내 파일을 찾을 수 없습니다.
Uncaught TypeError: Cannot read property 'imagesPath' of undefined
내가 CKEditor의 ASP.Net 버전을 다운로드에 프로젝트를 포함 시켰습니다 :이 CKEDITOR.config는 "templatesKey"템플릿을로드하려고 시도와 함께 그렇게 실패 후
[blocked] The page at 'https://...' was loaded over HTTPS, but ran insecure content from 'http://...' (page not found url): this content should also be loaded over HTTPS.
내 해결책. 나는 뒤에 코드에서 myCKEditor.TemplatesFiles 및 myCKEditor.Templates을 설정하고 있습니다 :
myCKEditor.TemplatesFiles = "['" + relativePath + "']";
myCKEditor.Templates = "templateskey";
내가 동적으로 JS 파일을 생성하고있어 문제인가? 아니면 템플릿 플러그인이 HTTPS가 아닌 HTTP를 통해 콘텐츠를로드하는 문제입니까? 동적으로 템플릿을 CKEditor에 추가하는 더 좋은 방법이 있습니까?
가능한 솔루션입니다. http://stackoverflow.com/questions/12636696/ckeditor-template-loaded-from-ajax – Ewert