Trying to get jason off the controller. I wrote the ayak in the middle of the Jsp itself, when I send the request to the controller of the response, I receive a sheet that I needed, status 200 (OK), but I don’t get into the success block. In Intelej IDE writes that you need to check something on the global scope , but if global variables were not correctly defined, then I would not be able to send any data to the controller in any way. The question is, why am I just not getting into the success block?
code:
function getStudentId() { $.ajax({ url: '/subjects', dataType: 'json', data: { id: $("#selectStud").val() }, type: 'GET', success: function (data) { $.each(data, function (value) { $("#subjectname").append(value.name); $("#mark").append(value.mark); }); }, error: function (xhr, status, errorThrown) { alert('adding component failed with status: ' + status + ". " + errorThrown); } }); }