Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ckeditor files included by script with wrong url

Tags:

ckeditor

I have a simple page...and i use ckeditor it works just fine o the localhost but wen i publish to azure it dose-nt work anymore... here is the site http://testckedit.azurewebsites.net/ the code:

bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
                  "~/Scripts/bootstrap.js",
                  "~/Scripts/respond.js",
                  "~/Scripts/ckeditor/ckeditor.js"
                  ));

and the View:

@{
     ViewBag.Title = "Index";
 }

<h2>Index</h2>


<div class='description'>
    <p>
    This editor is using an <code>&lt;iframe&gt;</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>

i got a few error at console:

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 
like image 996
emanuel.virca Avatar asked Jan 17 '14 08:01

emanuel.virca


2 Answers

I think that setting CKEDITOR.basePath should do the trick for you.

like image 91
oleq Avatar answered Oct 24 '22 09:10

oleq


Set window.CKEDITOR_BASEPATH properly, like window.CKEDITOR_BASEPATH = 'http://localhost/public/resources/ckeditor/';

window.CKEDITOR_BASEPATH should have the proper path of the ckeditor folder which contains plugins,skins and other folders, js files with utility functions.

window.CKEDITOR_BASEPATH will set CKEDITOR.basePath autometically.

Try to set window.CKEDITOR_BASEPATH before requiring ckeditor.js

like image 42
Santanu Nandi Avatar answered Oct 24 '22 11:10

Santanu Nandi