I have 2 examples of a function that retrieves json-data and gives an alert.
In this example, everything goes fine: 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 in the second example, there is no alert displayed. Why? The only difference is the service where the json is retrieved. The json-object looks perfectly valid 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 get no JS-errors. I also tried this local (so not on JSbin but with a htm-file on my pc) and this doesn't work either.
Can someone explain what I am doing wrong?