我在 ajax 调用后收到以下内容response
在 PHP 中使用json_encode
:
"['2013-02-24', 0]", "['2013-02-25', 0]", "['2013-02-26', 1]", "['2013-02-27', 6]", "['2013-02-28', 6]", "['2013-03-01', 3]", ...
我怎样才能在JavaScript中从这个数组中创建一个数组?这可能吗?我的意思是,我尝试过使用 jQuerymakeArray
或与parseJSON
没有成功。最优选的方法是什么?
Edit:
function submitForm(t) {
$.ajax({type:'GET', url: 'charts.php', data:$(page_id).serialize(), success:
function(response) {
var myFanRemovesData = new Array(response);
var myChart = new JSChart(chart_id, 'line');
myChart.setDataArray(myFanRemovesData);
我必须使用数组的数组来设置myFanRemovesData
with it