2 Replies Latest reply on Nov 28, 2014 5:25 AM by vishymuku

    problems with loading JSON data

    vishymuku

      Hi,

       

      I have been following Simon Widjaja(EDGEDOCKS) YouTube lesson for loading external JSON data. But i'm not able to at least log the data to console.

      I get this error: "avascript error in event handler! Event Type = element"

       

      content.json is in the home folder. Data in it is very simple:

      [

        {

        "title": "TITLE 1",

        "description": "DESCRIPTION 1"

        },

        {

        "title": "TITLE 2",

        "description": "DESCRIPTION 2"

        }

      ]

       

      And here's the code in edgeActions.js:

      (function($, Edge, compId){

      var Composition = Edge.Composition, Symbol = Edge.Symbol; // aliases for commonly used Edge classes

         //Edge symbol: 'stage'

         (function(symbolName) {

               Symbol.bindElementAction(compId, symbolName, "document", "compositionReady", function(sym, e) {

               // loading external json data

               $.ajax({

               type: "GET",

               cache: false,

               url: "content.json",

               datatype: "json",

               success: function(data){ console.log("data: ", data); },

               error: function() { console.log("something went wrong"); }

               });

       

            });

            //Edge binding end

       

         })("stage");

         //Edge symbol end:'stage'

       

      })(window.jQuery || AdobeEdge.$, AdobeEdge, "EDGE-11125477");

       

      I have tried $getJSON also as mentioned in the youtube video.

      Please note: I don't get "something went wrong" also logged.

       

      I'm using the free trial version. Is this is a limitation in the free trial?