0👍
✅
Please try using the following structure for your ajax request:
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
$.ajax({
url: "/map",
type: 'POST',
data: {},
success: function (data) {
console.log("AJAX END");
}
});
And maybe there is just a problem with your debug "<script>console.log('NewChart funtion called');</script>"
but everything is working fine. Just try to use the data that is returned.
success: function (data) {
$('#someDiv').html(data);
}
Source:stackexchange.com