Getting Serverside data on handling event

27 views
Skip to first unread message

jeena binex

unread,
Apr 12, 2020, 11:06:12 PM4/12/20
to Google Visualization API
Below is a snippet of my Client Side Code in Java script

 google.visualization.events.addListener(chart, 'select', selectHandler);

function selectHandler(e) {
             alert('A chart was selected');
           
       // Want to call server side data here , how do I do ?

}


SJW

unread,
Apr 15, 2020, 1:36:01 AM4/15/20
to Google Visualization API
Ajax:

 var postData = [];
 postData.push({name: 'key', value: '200'});

 $.ajax({
   url
: "get-data.php",
   method
: "POST",
   data
: postData,
   dataType
: "json",
   async
: false,
   success
: function (response) {
      data
= response;    
   
},
   error
: function(xhr, status, error){
     
do something;
   
}
 
});
Reply all
Reply to author
Forward
0 new messages