问题
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