I've created an simple AJAX call tho get JSON data from an cross domain URL. With the real URL i run allways in an error, an example with another cross domain call is running successful.
var json_url_1 = 'http://operation-wigwam.ingress.com:8080/v1/test-info?callback=parseResponse',
json_url_2 = 'http://operation-wigwam.ingress.com:8080/v1/test-info',
json_url_3 = 'https://jsonplaceholder.typicode.com/users/1';
$('#real1').click(function(){
$.ajax({
type: "GET",
dataType: "jsonp",
url: json_url_1,
xhrFields: {
withCredentials: false
},
success: function( data ){
console.log( data);
},
error: function() {
console.log( 'an error occurred');
}
});
});
$('#real2').click(function(){
$.ajax({
type: "GET",
dataType: "jsonp",
url: json_url_2,
xhrFields: {
withCredentials: false
},
success: function( data ){
console.log( data);
},
error: function() {
console.log( 'an error occurred');
}
});
});
$('#example').click( function(){
$.ajax({
type: "GET",
dataType: "jsonp",
url: json_url_3,
xhrFields: {
withCredentials: false
},
success: function( data ){
console.log( data );
},
error: function() {
console.log( 'an error occurred');
}
});
});
What's going wrong with the original URL?
Example here: http://jsbin.com/cesehiy/edit?js,console,output