How can I use the CDN version of CKEditor with an alternative skin hosted on my server?

僤鯓⒐⒋嵵緔 提交于 2019-12-13 05:49:18

问题


I have read the documentation and countless posts about using alternative skins (as opposed to the standard 'moono' skin) with CKEditor. I am using the CDN version of CKEditor, but I want to use a different skin. So, I have downloaded the skin of choice (bootstrapck) and I am hosting it from my server. Everything works great, until I push it to my production server. In production it is not recognizing the alternative skin I wish to use. Here is what I have:

<!DOCTYPE html>
<html lang="en">
<head>
    <script src="https://cdn.ckeditor.com/4.4.7/full/ckeditor.js"></script>
    ....
</head>
<body>
    <textarea name="editor1" id="editor1"></textarea>
    <script>
        CKEDITOR.replace('editor1', {
            skin : 'bootstrapck,/lib/ckeditor/skins/bootstrapck/'
        });
    </script>
</body>

This exact same code works perfectly on my local testing server, but it doesn't work at all on my production server. Here is what I see in the console on production:

Refused to execute script from 'https://www.example.com/lib/ckeditor/ckeditor.js' 
because its MIME type ('text/html') is not executable, 
and strict MIME type checking is enabled.

回答1:


Your production server is serving .js files with incorrect mimetype. If your production server is Apache ensure you have mod_mime and the following line in the httpd.conf

AddType text/javascript .js


来源:https://stackoverflow.com/questions/29189984/how-can-i-use-the-cdn-version-of-ckeditor-with-an-alternative-skin-hosted-on-my

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!