I am trying to run the following:
$.getJSON('http://services.digg.com/2.0/story.getTopNews?limit=25&callback=?', function(data) {
console.log(data);
});
But I get:
story.getTopNews: -1Resource is interpreted as Script, but passed with the MIME type application / json. story.getTopNews: 2Uncaught SyntaxError: Unexpected token:
I also tried something like this:
var url = "http://services.digg.com/2.0/story.getTopNews?limit=25";
$.ajax({
url: url,
crossDomain:true,
dataType: "json",
success:function(data,text,xhqr) {
console.log(data);
}
});
I get this:
XMLHttpRequest cannot load http://services.digg.com/2.0/story.getTopNews?limit=25 . The origin of http://sumews.com is not permitted by Access-Control-Allow-Origin. services.digg.com/2.0/story.getTopNews?limit=25GET http://services.digg.com/2.0/story.getTopNews?limit=25 undefined (undefined)
Any help would be greatly appreciated.
source
share