I have 2 examples of a function that retrieves json data and issues a warning.
In this example, everything is going well: http://jsbin.com/uwupa3/edit
$(document).ready(function(){ var timeService = "http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?"; $.getJSON(timeService, function(data) { alert(data); }); });
But the second example does not display a warning. What for? The only difference is the service in which json is retrieved. Json-object looks absolutely fair to me: http://jsbin.com/uwupa3/2/edit
$(document).ready(function(){ var timeService = "http://json-time.appspot.com/time.json?tz=Europe/Brussels"; $.getJSON(timeService, function(data) { alert(data); }); });
I do not get JS errors. I also tried this local one (not JSbin, but with the htm file on my computer), and this also does not work.
Can someone explain what I'm doing wrong?
source share