score:29
Accepted answer
Valid JSON strings require the property names to be quoted.
This can be corrected by quoting the property names like below:
JSON.parse('[{"x": 1, "y": 0}, {"x":2, "y":5, "marker": {"fillColor":"red"}}, {"x":3, "y":8}]');
score:3
As it was said earlier JSON object names must to be quoted. So JSON.parse will parse only that string, valid JSON.
But if you can't for any reason change format of your string you can also parse it using eval
function which can accept your syntax. But be careful! That's pretty good way for exploit.
Source: stackoverflow.com
Related Query
- SyntaxError: JSON.parse: expected property name or '}' while using highcharts
- Is there any way to assign "Alt" property while using Highcharts
- Getting error while using highcharts in Angular 7
- getting error#17 from highcharts while using solid gauge from backbone rails
- Formatting JSON data monthwise for HighCharts using MySQL
- how to parse json into highcharts
- How get data name in Highcharts pie chart legend instead of "Slice" using array of values?
- Highcharts phantomjs export server can't parse json string
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- Browser hanged while plotting more than 10000 series using Highcharts
- How to parse JSON into HighCharts line graph?
- How to set 'lang' property in Highcharts using Angular JS?
- Using Highcharts formatter causes Cannot read property 'length' of undefined
- Highcharts Solid Gauge Dynamic Update Using JSON
- passing json values to highcharts from .net code behind
- Charts using Highcharts with multiple series from JSON
- passing formatting JavaScript code to HighCharts with JSON
- Highcharts Dynamic Drilldown using json
- Using HIghcharts on Codeigniter to get data name and total
- Parse json and give to category in Highcharts
- Highcharts display label for pie chart using html table as data source
- Getting error while using pattern in Angular Highcharts
- Changing the name for 'categories' of x axis while implementing crossfilter with highcharts
- dynamic chart with Highcharts using json
- Basic Highcharts Multiple Series Chart Using JSON
- Plot a bar graph using Highcharts drilldown with two different JSON end points
- Gson to get Json value for a pie chart using Highcharts
- How to show other point property in bubble highcharts using tooltip
- Using Json in HighCharts
- HighCharts title styles i.e textDecoration property not applying when we export the chart using canvg
More Query from same tag
- In highcharts, how do I get all categories showing with multiple series and xAxis type set to category?
- How to retain the conditional color of bar in highcharts
- Make HighCharts Axis Labels being and end at my min/max
- how to Extend highchart plot band outside graph using android wrapper
- Animation behave differently between initial load and dynamic data series replacement in Highcharts
- Highcharts Stacked Column chart from JSON not charting correct values
- i want to show/hide y axis grid lines of highchart by onclick on button
- Set series color based on X axis on a column Highchart
- Background on the bar not getting removed from Highcharts
- How to remove margin gap in area spline chart for highcharts?
- Why can't I get individual bar colors in a candlestick chart in highstocks.js for more than 55 bars?
- Dynamically high chart rendering not working
- How to add comma formated labels for Y-axis in Highcharts?
- (Highcharts) x axis date format doesn't match to tooltip's date format
- Add highchart graph to mpdf()
- Highcharts csv export issue
- Highchart Callback Refactoring not working, and how to display multiple series using multiple Ajax data
- Highcharts Heatmap yAxis with 2 categories. How to show both of them in the tooltip?
- Tick and label for every xAxis Unit in Highcharts Chart
- Highcharts 4.0.3 stacked bar chart bug adds รข-
- HighStock HighCharts Setting Flag on Click Event
- How to align highchart legend when using multiple pie chart in one container?
- High Chart X Axis to display month and year
- JavaScript - iterating through an array for checking condition
- highcharts Scatter Chart not loading with LOTS of data
- Highstock line chart series processedYData is wrong
- How draw plot lines on a solid gauge charts
- How to get the highlighted point from shared tooltip formatter, Highcharts
- display content on highcharts Xaxis and Yaxis title in form of subscript and superscript
- Genealogy Chart/Family Tree