Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 322
nataila Avatar asked May 28 '15 05:05

nataila


1 Answers

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

like image 168
quw Avatar answered Nov 19 '22 04:11

quw