-1

Having trouble pulling up data from the JSON feed using Jquery. Can somebody please help. Just trying to get the title from the "stories" array from now and work my way up. What am I doing wrong??

$(document).ready(function(){
  //Tell the function where the feed is located
  $.getJSON("http://www.sfarts.org/sfarts/jftemp/sfartsJSONAPI.cfc?method=getTenStoriesfixed&returnformat=JSON#sthash.jmTrJRUN.dpuf", function(data) {
    //Grab each of the "entries"
    $.each(data.stories, function(i,item){
      //Only grab "entries" 10 times
      if(i < 10){
        //Create the links and throw them
        //into the body of the page
        $("body").append("<p>"+item.title+"</p>");
      }
    });
  });
});
Paul Roub
  • 35,100
  • 27
  • 72
  • 83
  • Without seeing the JSON in question it's kind-of hard to say. You also have not described what's happening. Are there errors reported? Does it do something you don't expect, or not do something you do expect? – Pointy May 13 '14 at 22:20
  • 2
    As I see it is `.TITLE`, not `.title`. – Artyom Neustroev May 13 '14 at 22:22
  • Also `.STORIES` and not `.stories` – Pointy May 13 '14 at 22:24
  • Here's the feed. http://www.sfarts.org/sfarts/jftemp/sfartsJSONAPI.cfc?method=getTenStoriesfixed&returnformat=JSON#sthash.jmTrJRUN.dpuf Does anyone know how I can use JSONP to simply pull out IMAGEPATH? I can figure out the rest. – user3335117 May 13 '14 at 23:54

1 Answers1

2

Be sure to include jQuery first:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>

Then, you'll need to configure cross domain policies to allow receipt of data from another domain. Here's the top document covering that info on stackoverflow: jQuery AJAX cross domain

Community
  • 1
  • 1
Brian Anderson
  • 589
  • 5
  • 20