4 Replies Latest reply on May 27, 2014 4:05 AM by heathrowe

    json, Failed to load resource

    Fea

      Hello, i'm trying to make a slide based on a .json file, but i can't manage in making the animation run.

       

      code for stage:

       

       

      $.getJSON("data.json").success(

                function(data){

                          $.each(data, function(index, item){

                          var s = sym.createChildSymbol("template", "content");

                          s.$("title").html(data[i].title);

                          s.$("description").html(data[i].description);

                          s.$("price").html(data[i].title);

                          s.$("img").css({"background-image":"url('"+data[i]. image+"')"});

      s.play();

                          });

      });

       

       

      .json file:

       

      [

      {

      "title": "Fragrance 1",

      "description": "Orange & pineapple",

      "price": "15$",

      "img": "images/img1.jpg"

      },

      {"title": "Fragrance 2",

      "description": "Apple & orange",

      "price": "15$",

      "img": "images/img2.jpg"

      },

      {

      "title": "Fragrance 3",

      "description": "Cacao",

      "price": "15$",

      "img": "images/img3.jpg"

      },

      {

      "title": "Fragrance 4",

      "description": "Apricot",

      "price": "15$",

      "img": "images/img4.jpg"

      },

      {

      "title": "Fragrance 5",

      "description": "Coconut",

      "price": "15$",

      "img": "images/img5.jpg"

      },

      {

      "title": "Fragrance 6",

      "description": "Lemon",

      "price": "15$",

      "img": "images/img6.jpg"

      },

      {

      "title": "Fragrance 7",

      "description": "Banana",

      "price": "15$",

      "img": "images/img7.jpg"

      }

      ]

       

       

      (the file is there)

       

      The error:

       

      Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:54321/_DRIVE_C_EVIRD_/Users/Lee/Desktop/Jsonslider/data.json

       

       

      Any help appreciated, if possible..

       

      !

       

      Fea.