2016-08-15 164 views
2

我使用CKEDITOR CDN这样CKEDITOR CDN使用皮肤HTTPS

<script src="https://cdn.ckeditor.com/4.5.10/full-all/ckeditor.js"></script> 

var instance = CKEDITOR.replace('myEditor'), { 
      customConfig: '/path/to/my/config.js', 
     }); 

在我config.js

CKEDITOR.editorConfig = function (config) { 
    config.defaultLanguage = 'fr'; 
    config.skin = 'moonocolor'; 
}; 

我得到这个错误

Mixed Content: The page at 'https://local.mysite.fr/app_dev.php/admin/page/4' was loaded over HTTPS, but requested an insecure script 'http://cdn.ckeditor.com/4.5.10/full-all/skins/moonocolor/skin.js/'. This request has been blocked; the content must be served over HTTPS. 

上午什么我做错了?有没有办法让CKEDITOR在HTTPS中加载皮肤?

回答

1

该消息具有误导性。这里发生的事情:

如果发现皮肤(moono,例如),它都通过HTTP和HTTPS的访问:

https://cdn.ckeditor.com/4.8.0/full-all/skins/moono/skin.js

http://cdn.ckeditor.com/4.8.0/full-all/skins/moono/skin.js

但moonocolor不上CDN,和cdn.ckeditor.com将所有404重定向到HTTP,导致浏览器报告您正在服务于不安全的内容。

我还没有找到任何关于此的明确文件,但似乎ckeditor只在CDN上包含一些官方皮肤。如果你想使用一个不在那里的东西,你需要从你自己的服务器上提供它(How can I use the CDN version of CKEditor with an alternative skin hosted on my server?可能是一个很好的开始)。

+0

该死的,已经很久了:)下次我会看看这个项目。谢谢你的帮助。 – Charly