I'm trying to load data from the output of a PHP called test2.php file and put it into a graph
HTML:
<html>
<body>
<div class="ct-chart ct-perfect-fourth"></div>
<div id="data"></div>
</body>
</html>
jquery:
$(document).ready(function(){
$("#data").load("test2.php #numbers ", function(result){
console.log(result);
var data = result.split(",").slice(1);
var last_element = data[data.length - 1];
new Chartist.Line('.ct-chart', {
labels: data,
series: [data]
}, {
fullWidth: true,
height: 650,
chartPadding: {
right: 0
}
});
});
});
The graph shows 0 for the last number and console.log(result);
returns:
<div id='number'>,-0.05,-0.07,-0.07,-0.07,0.14,0.14,0.09,0.07,0.07,0.07,0.07,0.65,0.63,0.63,0.63,0.63,0.63,0.58,0.56,0.56,0.56,0.56,0.84,0.79,0.77,0.77</div>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<form action="" method="post" enctype="multipart/form-data">
<input type="file" name="pokerHand[]" id="pokerHand" multiple="multiple" />
<input type="submit" id="submit" value="submit" name="submit">
<input type="hidden" name="test" value="abc" id="test" />
</form>
</body>
</html>
Wich is the output of my php file however <div id="data"></div>
contans <div id='number'>[the numbers]</div>
how do i get .load to return the same content that it loads to the page