我有一个简单的页面......我使用ckeditor它可以很好地工作在本地主机但是我发布到azure它剂量工作了... 这是网站 http://testckedit.azurewebsites.net/ 代码:
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
"~/Scripts/bootstrap.js",
"~/Scripts/respond.js",
"~/Scripts/ckeditor/ckeditor.js"
));
和视图:
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
<div class='description'>
<p>
This editor is using an <code><iframe></code> element-based editing area, provided by the <strong>Wysiwygarea</strong> plugin.
</p>
</div>
<textarea cols="80" id="editor1" name="editor1" rows="10"></textarea>
@section scripts{
<script>
$(document).ready(function () {
// This call can be placed at any point after the
// <textarea>, or inside a <head><script> in a
// window.onload event handler.
// Replace the <textarea id="editor"> with an CKEditor
// instance, using default configurations.
CKEDITOR.replace("editor1");
});
</script>}
<p>
<input type="submit" value="Submit">
</p>
我在控制台上遇到了一些错误:
Failed to load resource: the server responded with a status of 404 (Not Found) /config.js?t=DBAA
Failed to load resource: the server responded with a status of 404 (Not Found) /skins/moono/editor.css?t=DBAA
Failed to load resource: the server responded with a status of 404 (Not Found) /lang/ro.js?t=DBAA
Uncaught TypeError: Cannot set property 'dir' of undefined
答案 0 :(得分:16)
我认为设置CKEDITOR.basePath
应该适合你。
答案 1 :(得分:7)
正确设置window.CKEDITOR_BASEPATH,就像 window.CKEDITOR_BASEPATH =&#39; http://localhost/public/resources/ckeditor/&#39;;
window.CKEDITOR_BASEPATH应该有ckeditor文件夹的正确路径,其中包含插件,皮肤和其他文件夹,带有实用功能的js文件。
window.CKEDITOR_BASEPATH将自动设置CKEDITOR.basePath。
在要求ckeditor.js之前尝试设置window.CKEDITOR_BASEPATH