Hello I have an ajax request, which gets data as json as callback. The content-type is not displayed in the response header and i get null when i check in the console. My code:
$.ajaxSetup({
cache: false
beforeSend: function (jqXHR) {
...
},
complete: function (jqXHR) {
....
}
});
function loadData(div, url) {
$('#' + div).jstree({
core: {
data: function (node, cb) {
$.getJSON(url + node.id)
.done(function (data, status, xhr) {
cb.call(this, data);
.......
The response looks like:
And i get XML processing error: syntax error
I tried adding 'Content-Type': 'appplication/json'
to the $.ajaxSetup
but there was no change. How can i handle this error. Should it be in the ajaxsetup or in the $.getJSON
function.