用Google Translator脚本转换的页面中的SvG元素抛出 [英] SvG element in a page transulated with google transulator script error is thrown

查看:62
本文介绍了用Google Translator脚本转换的页面中的SvG元素抛出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在页面中使用SVG元素,并将页面转换为德语时,我在控制台中遇到以下脚本错误.

I am using the SVG element in a page and when transulating the page to german language I am facing the following script error in console.

错误:未捕获的TypeError:a [b] .target.className.indexOf不是功能"

error: "Uncaught TypeError: a[b].target.className.indexOf is not a function"

有人对此有解决方案吗?

have anyone got a solution for this?

推荐答案

这与在Chrome中安装了Google翻译扩展程序以及SVG元素有关.在GitHub上有一个很好的评论

It's related to having Google Translation Extension installed in Chrome together with SVG elements. There's a really good comment on GitHub to why this error happens.

SVG的类型为 SVGElement ,并且 className 属性是 SVGAnimatedString 的实例,该实例不具有 indexOf()函数.目前尚无针对Google翻译+ SVG方案的已知修复程序.

SVG's are of type SVGElement and the className property is an instance of SVGAnimatedString which doesn't have the indexOf() function. There's currently no known fix for the Google Translation + SVG scenario.

这篇关于用Google Translator脚本转换的页面中的SvG元素抛出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆