Jump to content

jQuery help


c_pattle

Recommended Posts

I have a global variable called options that I have defined which is an array. 

 

var options = {
series: [{
	type: 'pie',
	name: 'Title 2 Rating Distribution',
	data: []
}]
};

 

How do I then insert something into this array from another function?  For example I want to perform an ajax request and then copy the returned data into the variable called "data". However if I try to do the follow it says that "options.series.data is undefined". 

 

$.ajax({
url: 'ajax/pie_chart_data.php',
success: function(point) {
    options.series.data.push(point);
},
});

 

Thanks for any help. 

Link to comment
https://forums.phpfreaks.com/topic/228744-jquery-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.