$( document ).ready(function() {
$.ajax({
url: 'http://mylink.com',
type: 'GET',
dataType: 'json',
crossDomain: true,
success: function(data){
console.log(data.object.array.id);
},
beforeSend: function (xhr) {
xhr.setRequestHeader ("Authorization", "Token " + "mytoken");
},
});
});
$( document ).ready(function() {
$.ajax({
url: 'http://mylink.com',
type: 'GET',
dataType: 'json',
crossDomain: true,
success: function(data){
for (var i = 0, l = data.length; i < l; i++) {
console.log(data[i].id);
}
},
beforeSend: function (xhr) {
xhr.setRequestHeader ("Authorization", "Token " + "mytoken");
},
});
});