I trying to validate my page but have one error to fix.
I am using Google charts within my code. to populate the chart i require data to be filled in within the JavaScript shown in the code below.
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([ <?php echo $data; ?> ]);
var data2 = google.visualization.arrayToDataTable([ <?php echo $datagoing; ?> ]);
var options = {
backgroundColor: 'transparent',
legend: 'none',
height: '100px',
width: '100px',
chartArea: { height :"95%", width:"95%" },
};
var options2 = {
backgroundColor: 'transparent',
legend: 'none',
height: '100px',
width: '100px',
chartArea: { height :"95%", width:"95%" },
};
var chart = new google.visualization.PieChart(document.getElementById('piechart<?php echo $loop ?>'));
chart.draw(data, options);
var chart2 = new google.visualization.PieChart(document.getElementById('piechartgoing<?php echo $loop ?>'));
chart2.draw(data2, options2);
}
</script>
this is within a loop so the code is generated multiple times as you can see by looking at the source of my page http://mr-tipster.com/pages/newcard.php?venue=Warwick&time=3:05
my question would be how can i do this while keeping the page html validated: http://validator.w3.org/check?uri=http%3A%2F%2Fmr-tipster.com%2Fpages%2Fnewcard.php%3Fvenue%3DWarwick%26time%3D2%3A30&charset=%28detect+automatically%29&doctype=Inline&group=0
drawChartfunction just once, then calling it with the required parameters.PHP WHILE?XHTML 1.0 Transitionalintended? If you're not particularly aware of the differences between XHTML, HTML 4.01, and HTML5, you could try changing your top line to<!DOCTYPE HTML>(HTML5) and see how well that validates.