score:0
you can try eval function
the eval() function evaluates javascript code represented as a string.
eval(string)
eval(" var s='hello'; alert(s);");
score:1
if all of the contents of the #data element is properly formatted, all you'll actually have to do is grab the inner html of that element and parse it into json.
// this is the contents of #data as a string
var data_as_a_string = document.getelementbyid("data").innerhtml;
// and here it is "in javascript" as an object
var data_as_an_object = json.parse( data_as_a_string );
Source: stackoverflow.com
Related Query
- HTML Content to Javascript Code
- JavaScript - Export Div with SVG chart + HTML as and Image
- HighCharts is undefined because multiple Html pages in Javascript file
- How to export the whole page or html content with Highcharts not just the chart?
- Optimize JavaScript DrillDown code
- Dynamic PDF from html that contains Javascript
- JavaScript code inside TypeScript file .ts not working
- c# WPF Webbrowser with Highchart, Javascript from external source not working "An error has occurred in the script on this page"
- Display HTML table inside a DIV using Javascript switch statement
- passing formatting JavaScript code to HighCharts with JSON
- Embed javascript code in a django template
- Get Tooltip content from a point from a line/scatter plot in highcharts from javascript
- Highcharts display label for pie chart using html table as data source
- Strange character in the Highstock source code
- HTML displaying values in JavaScript "data"
- HTML table as data source for highstock charts using highcharts
- tool that shows javascript errors in code
- Javascript - convert HTML div with SVG to image
- Repeating Javascript Code
- Basic Javascript: How can I link my HTML and Javascript on a Highcharts example?
- javascript Highcharts JSON data to HTML table
- Error: Data source must be a URL for refresh | console error | javascript | Highcharts
- Javascript Code not running in Wordpress Pages
- Generate javascript and html blocks on the fly
- Use HTML class as Highcharts table data source
- Use django variable (array of elements from sqlite3 database) inside javascript embedded code
- Moving javascript data series to html data attribute breaks Highchart
- How to add html content above series(Chart type - line)
- Javascript relative time 24 hours ago etc as time
- Highchart series update in javascript
More Query from same tag
- Call asynchronous functions inside loop
- Remove Highchart series in shiny
- Having issues to make the data value in centre in pie chat using high charts
- Remove Highcharts chart Y axis labels when legend clicked
- Highcharts isn't displaying the data
- Highcharts Highmaps How to add mappoint to custom map
- How to plot multiple lines in a single graph using HighChart with JSON
- HighCharts pie chart X-axies values are not displayed while trying to get data from MySQL database using PHP
- Remove border from multiple plots of Stacked and Grouped Column chart (Highcharts.js)
- Highcharts Y-Axis Limits
- Show empty series in highcharts
- Highcharts - Bubble chart - Moving gridlines
- Drilldown in a Highcharts Organization chart?
- Highcharts PHP JSON - correct data format
- Highcharts: adding symbol to inverted columnrange chart series
- HighCharts performance degrades dramatically with 'chart' and 'renderer' together
- Highstock plotting images that follow series when scrolling
- my highchart is currently is not working with pie spline chart in updating after rendering chart
- Highcharts graph should start entirely to the left and end entirely to the right
- HighCharts organization diagram font size
- Using colour and shapes together in legend
- data label is not shown Highcharts
- HighCharts : Exporting jpeg with background in styled mode
- Need total value of two columns on Tooltip High charts
- Highcharts JS Uncaught TypeError: x[(intermediate value)(intermediate value)(intermediate value)] is not a constructor
- Highcharts exporting functionality not working in latest release
- Referencing array values within nested objects/arrays
- Show specific series values in the stack label using highcharts
- Highcharts JSON multiple series
- highcharts first and last category width