【发布时间】:2017-05-09 02:54:38
【问题描述】:
当我尝试在产品描述中添加图片时,出现以下错误:
“资源解释为文档,但使用 MIME 传输”。
仅当我搜索文件夹中的图像时才会发生这种情况。根目录中的图像正常工作。
当我在某个文件夹中选择图像时,图像会在另一个选项卡中打开,并且不会添加到描述内容中
【问题讨论】:
标签: javascript php mime-types opencart2.x
当我尝试在产品描述中添加图片时,出现以下错误:
“资源解释为文档,但使用 MIME 传输”。
仅当我搜索文件夹中的图像时才会发生这种情况。根目录中的图像正常工作。
当我在某个文件夹中选择图像时,图像会在另一个选项卡中打开,并且不会添加到描述内容中
【问题讨论】:
标签: javascript php mime-types opencart2.x
我发现了问题!修复 /admin/view/javascript/common.js 文件。
寻找一行 //$ ('# modal-image a.thumbnail'). In ('click', function (e) {
内部函数
// Replace the summernotes image manager
('Summernote'). Each (function () {
替换
$ ('# Modal-image a.thumbnail'). On ('click', function (e) {
E.preventDefault ();
$ (Element) .summernote ('insertImage', $ (this) .attr ('href'));
$ ('# Modal-image'). Modal ('hide');
});
通过
$ ('# Modal-image'). Delegate ('a.thumbnail', 'click', function (e) {
E.preventDefault ();
$ (Element) .summernote ('insertImage', $ (this) .attr ('href'));
$ ('# Modal-image'). Modal ('hide');
});
【讨论】: