My JS is on the POSTs page to generate the PHP script diagrams, and what the PHP script returns is added to the page (.html () div). However, using the Google Charts API, the page is empty. I get an error Container not defined from google library. This is what the PHP script passes:
<script>google.load('visualization', '1', {packages: ['corechart']}); google.setOnLoadCallback(drawChart); function drawChart() { var data = google.visualization.arrayToDataTable([ ['Date', 'BTC Price'],['2013-02-12', 22.5] ]); alert(document.getElementById('chart_div')); var chart = new google.visualization.LineChart(document.getElementById('chart_div')); chart.draw(data, {title: 'BTC/USD price'}); }</script><div id='chart_div' style='width: 900px; height: 500px;'></div>
Why did document.getElementByID return null if chartContent is equipped? ''
EDIT : Now the warning is not displayed, but the page is still empty.
source share