繁体   English   中英

ckeditor中的简单图像浏览器

[英]Simple Image Browser in ckeditor

我正在使用来自asped.net mvc4的来自ckeditor( http://ckeditor.com/addon/simple-image-browser )的简单图像浏览器插件。

我试图像在其文档中一样使用它,但是它仍然无法正常工作。

我的脚本是:

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM