i'm trying to use cart.com API and retrieve json file using JQuery $.ajax like this
$(function(){
$.ajax({
type: 'GET',
dataType: 'jsonp',
contentType: 'application/json; charset=utf-8',
crossDomain: 'true',
async: false,
jsonp: "callback",
url: 'http://fadi%40example.com:Gu86P606iU3026G3587rT15S4q8i31D4@demos.cs-cart.com/54bbdcef36bac/api.php?_d=Settings&ajax_custom=1',
complete: function(result){
console.log(result);
},
success: function(data) {
var data1 = $.parseJSON(data);
console.log(data1);
},
error: function(jqXHR, exception) {
if (jqXHR.status === 0) {
alert('Not connect.\n Verify Network.');
} else if (jqXHR.status == 404) {
alert('Requested page not found. [404]');
} else if (jqXHR.status == 500) {
alert('Internal Server Error [500].');
} else if (exception === 'parsererror') {
alert('Requested JSON parse failed.');
} else if (exception === 'timeout') {
alert('Time out error.');
} else if (exception === 'abort') {
alert('Ajax request aborted.');
} else {
alert('Uncaught Error.\n' + jqXHR.responseText);
}
}
});
});
so when i run it tell me Requested JSON parse failed
and in the response the data comes as js file how can i get this data from the js
please any help please i have this problem from three days till now and i can't get the data from the js file i will be most thankful for any help.