简单的图像浏览器在ckeditor

Simple Image Browser in ckeditor

本文关键字:ckeditor 浏览器 图像 简单      更新时间:2023-09-26

我使用简单的图像浏览器插件从ckeditor(http://ckeditor.com/addon/simple-image-browser)与asp.net mvc4.

我试着像在它的文档中那样使用它,但它仍然不起作用。

我的脚本是:
CKEDITOR.replace('editor1');
CKEDITOR.config.extraPlugins = 'simple-image-browser';
CKEDITOR.config.simpleImageBrowserURL = "/Home/SomeActionMethod";

,我的控制器是:

public JsonResult SomeActionMethod(){
var items = new[] {
                  new {url = "http://localhost:63220/Images/heroAccent.png"}, 
                  new {url = "http://localhost:63220/Images/heroAccent.png"}};
    return Json(items, JsonRequestBehavior.AllowGet);
}

在控制台抛出一个错误:

Uncaught TypeError: Cannot read property 'length' of null
有人有使用它的经验吗?

@Prakash Rai - ITH:打开config.js文件,你会看到下面的代码:

return console.log(a),b=$.parseJSON(a)

如果你已经返回JSON,你应该替换

return console.log(a),b=a