nataila
nataila

Reputation: 1619

highcharts always console error ablout bubble_compiled.js?

I write a pie chart in my app
But it always error with bubble_compiled.js
when I click in pie, it don't has animate, and it show Uncaught TypeError: a.target.className.indexOf is not a function Why?

Upvotes: 9

Views: 5957

Answers (1)

quw
quw

Reputation: 2854

I've experienced the same error when clicking on my D3 charts.

bubble_compiled.js is part of the Google Translate Chrome Extension. Disabling/removing this extension will make the error go away, but this error should not affect your site at all.

This error is occurring because the extension has a mousedown listener which tries to check if the target element has the class "jfk-bubble-closebtn".

Relevant code in the extension (full source here):

P(window, "mousedown", function(a) {
    var b = Ub(document, "gtx-trans");
    b && (ec(b, a.target) ? a.preventDefault() : (Tc(b),
    dc(b)));
    -1 != a.target.className.indexOf("jfk-bubble-closebtn") && a.preventDefault()
}

Since you are using Highcharts, you might be trying to click on an SVG element. The type of an SVG class name is SVGAnimatedString, which unlike String does not have an indexOf method. So when the extension tries to call it, it fails because it does not exist.

See also: Chrome and a TypeError due to SVGAnimatedString

Upvotes: 27

Related Questions