Question

For some reason images wont display when i pull them from Flickr, here's the code i have so far. As you can see I have one of the URLs commented out, the one commented out actually works and displays the images but the URL before it (the one I actually need) won't work.

<!DOCTYPE html>
<html>
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 
<script src="http://ajax.googleapis.com/ajax/li`enter code here`bs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script> 
<script type="text/javascript">
$(document).ready(function () {
    $.getJSON("http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=bde2ddde05dd5e7abbc7a44b9abc12ef&tags=gtav%2C+grand+theft+auto%2C++rockstar&bbox=-122.65057757118905%2C37.71174524790033%2C-122.2214241288068%2C37.81705186562751+&has_geo=&format=json&nojsoncallback=?", displayImages1); <!--("http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=bde2ddde05dd5e7abbc7a44b9abc12ef&tags=gtav&format=json&jsoncallback=?", displayImages1); -->    
    function displayImages1(data) {

        $.each(data.photos.photo, function (i, item) {

            var photoID = item.id;

            lat = item.latitude;
            long = item.longitude;

            $('#images1').append(photoID);

            var photoURL = 'http://farm' + item.farm + '.static.flickr.com/' + item.server + '/' + item.id + '_' + item.secret + '_m.jpg';

            htmlString = '<img src="' + photoURL + '">';

            $('#images1').append(htmlString);

            $('#images1').append("<br/><hr/><br/>");



        });
    }
});
</script> 


</head>
<body>
<div id="images1"> </div>
<p>&nbsp;</p>

</body>        
</html>
Was it helpful?

Solution

Your link is not correct. The correct link is below. It ends with jsoncallback.

http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=bde2ddde05dd5e7abbc7a44b9abc12ef&tags=gtav%2C+grand+theft+auto%2C++rockstar&bbox=-122.65057757118905%2C37.71174524790033%2C-122.2214241288068%2C37.81705186562751+&format=json&jsoncallback=?
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top