Im sending some data with ajax to a php function which uses the data to get an array containing numbers from the database. I need to get this array to my javascript part to activate some checkboxes with it.
My ajax function:
function ajax2(info){
$.ajax({
type:"POST",
url:"publikationen2.php",
data: {output2: info},
dataType: 'json',
success: function(data){
alert(data);
},
error: function(data){
alert(data);
}
});
};
the end of the PHP part:
echo json_encode($IDarray);
The problem is, the alert is only triggering in the error call of the ajax. And it shows me:
[object Object]