公司项目中的文本编辑器需要用到富文本编辑器,于是就用了百度的ueditor,毕竟是大公司,没想到也坑人,在chrome上公司插件用不了,于是立即百度谷歌了一番。终于找到了解决方法,特发此文记录解决之法,以供以后参阅。这里还是要感谢谷歌大神,百度搜索真垃圾,不过因为一些你懂得的原因用不了谷歌,程序猿的苦啊!

ueditor 错误提示

Uncaught TypeError: target.node.getTransformToElement is not a function

ueditor公式插件kity formula在chrome运行报错的解决办法

ueditor 错误原因

这是因为Chrome V.48版本后移除了SVGElement.getTransformToElement函数,而导致在Chrome V.48及以上版本使用该插件会报错。

原文如下:SVGGraphicsElement.getTransformToElement has been removed to match the SVG spec.

意思是移除了 SVGGraphicsElement.getTransformToElement,以符合 SVG 规范。

解决方法

在插件根目录下的kityFormulaDialog.html文件中引入以下代码即可

    SVGElement.prototype.getTransformToElement = SVGElement.prototype.getTransformToElement || function(toElement) {
        return toElement.getScreenCTM().inverse().multiply(this.getScreenCTM());
    };

ueditor公式插件kity formula在chrome运行报错的解决办法

相关文章:

  • 2022-12-23
  • 2021-05-16
  • 2021-11-23
  • 2021-11-08
  • 2021-04-07
  • 2022-01-11
  • 2021-11-01
  • 2021-09-28
猜你喜欢
  • 2021-09-03
  • 2021-04-02
  • 2021-11-30
  • 2022-12-23
  • 2021-06-28
  • 2021-08-04
  • 2022-12-23
相关资源
相似解决方案