tags:

views:

52

answers:

2

I want to see an example of how to consume out of domain json service that returns list of items.

Can anyone point me towards a 'real' example to see how it is done.

A: 

see this example http://encosia.com/2008/08/20/easily-build-powerful-client-side-ajax-paging-using-jquery/

here IEnumberable is returned, but you can return Generic list and it will work same as above

VAstik
+1  A: 
$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?",
    function(data){
      $.each(data.items, function(i,item){
        $("<img/>").attr("src", item.media.m).appendTo("#images");
        if ( i == 3 ) return false;
      });
    });

Not entirely sure what you mean by 'consume the service', but this loads the four most recent cat pictures from the Flickr JSONP API.

source

Neil McKeown