I get this error when debugging javascript code using highcharts via Firebug. Here are the relevant lines of code:
var valpair = [parseInt(items[0]),cumulative]; rain_series.data.push(JSON.parse(valpair));
items[0]- it's simple "1234567", and if I add console.log(valpair)to my code, I get this output: [1234567, 0]which seems to be valid JSON. However, I was stuck in my mistake (I was looking for a solution but could not find it for my case).Anyone here who knows what I'm doing wrong?
items[0]
"1234567"
console.log(valpair)
[1234567, 0]
, JSON.parse, , . JSON.parse, .
JSON.parse
JSON.parse , , , .toString(). valpair = [1234567, 0], valpair.toString() 123457,0 (, , JS: 123457,0 Chrome). JSON: " " - .
.toString()
valpair = [1234567, 0]
valpair.toString()
123457,0
Source: https://habr.com/ru/post/1524967/More articles:Tightly pack a grid of list items in HTML - htmlAre SSE / long-polling connections connected to Heroku Unicorn processes? - ruby-on-railsGetting the target sail request from a policy scope - node.jst.test from summary statistics in R? - rDjango TypeError int () argument must be a string or a number, not a "QueryDict" - pythonRedirect all routes to another path and keep the rest of the URL intact - ruby-on-railsone-to-many mapping using the ref property not for the primary key - c #AngularDart directive list? - dartXamarin studio - set default search to case insensitive? - xamarin-studioReal-time drawing in Qt - c ++All Articles