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
- Plot dynamically added array elements using Highcharts.js
- Highstock / Highcharts - Flag linecolor masking line below it
- How to ser Highchart Grid Color pattern
- Stop Highcharts overwriting containers
- Highstock - Enable marker only on broken line
- How can I automate high charts and graphs using selenium webdriver?
- Cannot read property 'info' of undefined
- Highcharts only loads Title / Subtitle
- highcharts v3.0Beta bubblechart not rendering. Possible bug?
- Stock Highcharts date format
- Add label to line in Highcharts
- Horizontal bar chart with outline behind bar
- change marginLeft and marginRight from a javascript statment using highcharts
- DotNetHighcharts - How to only use first column of 2d array as Data
- Vertical areas along with line on the chart - is that possible
- Highcharts - Hidden charts don't get re-size properly
- Highcharts breaks after getting a variable's value with document.getElementById
- Highcarts with zoomType + default level
- Highcharts Tick Positions are not aligned on multiple Y-axises
- Extracting chart coordinates from touch events for custom HighCharts interaction
- JS HighCharts.js Pie data in different format
- highcharts. How to shade the area between two vertical lines?
- Plotline to touch the yaxis
- HighStock Navigator Handles are not moving
- Overlapping and rounded stack in stacked column graph in Highcharts
- HighCharts Line Chart draw y axis line for entire line points and only one line
- How to add space between chart and axis in highcharts
- Is it possible to change linecolor for timeline chart in between specific points?
- Is it possible to make all-custom point marker design in highstock?
- How to export gauge chart with custom marker using highchart?