I want to use webService, which gets JSON data from
$.ajax({ type: 'GET', contentType: 'application/json', dataType: 'JSON-P', //the url shows the correct JSON Data when I copy the URL in my browser url: 'http://url.com', success: function(data){ console.log(data); alert(data); }, error: function(xhr, testStatus, error){console.log("Error occured: "+error+" "+xhr+" "+testStatus)} })
In Firefox, it calls back with the error function, but I donβt know what the problem is, it would be great to know the error message, but my approach does not work. thanks in advance
edit: In Chrome, I get the following error:
The origin of null is not allowed by Access-Control-Allow-Origin.
edit: it is solved, the problem is that json does not work with the cross site and the data was not "jsonp-conform" (he needed to install the function (json data ...)) arround json data, This can be done by changing The URL at the end is "_ & jsonp = successCallback. Sorry to bother you.
source share