I am new to working with Ajax and have reached the point where I am able to retrieve data. However, I am struggling to return the data as I keep getting undefined values. Below is the code snippet:
function select_aragement(arragament){
var arrst = arragament;
var arrsplit = arrst.split("|");
var periode = arrsplit[0];
var id = arrsplit[1];
var data =$.ajax({
type: "POST",
url: 'ajax/prijzen.php',
data:{
id: id,
periode:periode
},
dataType: 'json'
});
return data.responseText;
}
The arragement
variable in this code represents an array.