Now I'm stuck at another point, with no idea about what the problem is:
On js:
// const data = JSON.stringify([smp.dsp[$(this).prop('selectedIndex')]]);
const data = JSON.stringify("hi");
console.log(data);
$.ajax({
type: 'POST',
dataType : 'json',
async: true,
url: 'php/save.php',
data: {data},
success: function () {alert("Thanks!"); },
failure: function() {alert("Error!");}
});
php/save.php
<?php
$json = $_GET['data'];
if (json_decode($json) != null) {
$file = fopen('toexecute.json','w+');
fwrite($file, $json);
fclose($file);
} else {
// user has posted invalid JSON, handle the error
}
?>
I got this error:

The aim is to send the currently selected item from a list to the server, and save it on a json file. (so SMP may load it at a latter point and do something: currently for device selection, preset selection and some menu selection)

PD: if someone wants to check the files and test it, have no problems sharing them to solve it asap.