views:

33

answers:

1

Hello everyone. So I am trying to show x amount of images from google using the following code, but it keeps returning invalid label. Does anyone have any ideas? thanks in advance for your help.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt;

<div id="google_images"></div>

<script type="text/javascript">
$(document).ready(function(){
var iURL = "http://ajax.googleapis.com/ajax/services/search/images?v=1.0&amp;q=kufa+castro&amp;format=json&amp;jsoncallback=?";
$.getJSON(iURL,function(json) {
    $(json).each(function() {
        $.each(json.results, function(i,item)
        {    
            //$("#google_images").append(item.unescapedUrl);
            $('#google_images').html();            
        });
    });
});

});

+1  A: 

You need to specify jsonp as dataType.

Have a look at this working: http://www.jsfiddle.net/FX79h/2/

jAndy
thanks but how would I parse the information itself?