1 Reply Latest reply on Oct 3, 2018 4:22 AM by Jon Brasher

    getJSON fails to retrieve data

    Blake Payne

      Ok.. on to the next problem.  I'm trying to follow the code example below:

      $.getJSON("4.5_week.geojson", function(resp) {
         var feat = resp.features,
         tableData = [];
         tableau.log("feat len:"+feat.length);
         // Iterate over the JSON object
         for (var i = 0, len = feat.length; i < len; i++) {
         tableData.push({
         "id": feat[i].id,
         "mag": feat[i].properties.mag,
         "title": feat[i].properties.title,
         "location": feat[i].geometry
         });  

      }

       

      I have pulled down the json file locally and its in the same dir as the WDC html and .js files.

      The logging never occurs. Its as if it never makes it in here. I can place a log in the jquery.min.js to see it hits getJSON but nothing happens here.

      In doing some research online, several folks on stackoverflow say that "features" is not valid? I have tried: resp.values but that doesnt work either.

      Has anyone gotten this example to work?

      thanks!

      -Blake