如何将CKEditor的CDN版本与服务器上托管的替代外观一起使用? [英] How can I use the CDN version of CKEditor with an alternative skin hosted on my server?

查看:81
本文介绍了如何将CKEditor的CDN版本与服务器上托管的替代外观一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了有关使用CKEditor使用替代皮肤(与标准的"moono"皮肤相反)的文档和无数篇文章.我正在使用CKEditor的CDN版本,但是我想使用其他皮肤.因此,我已经下载了所选择的皮肤(bootstrapck),并从服务器托管它.一切正常,直到将其推送到生产服务器.在生产中,它并没有识别出我希望使用的替代皮肤.这是我所拥有的:

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.

推荐答案

您的生产服务器正在提供具有错误mimetype的.js文件.如果您的生产服务器是Apache,请确保您具有 mod_mime 以及以下内容httpd.conf

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

这篇关于如何将CKEditor的CDN版本与服务器上托管的替代外观一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆