Json file in WebStorage

0 favourites
  • 4 posts
From the Asset Store
Source File, music and art pack for Android Negotiator
  • Hi,

    I have a Json file built with a name's list of Excel.

    The structure of my file is then:

    {"c2dictionary":true,

    data:{

    "nom_01":NOM Prénom",

    "nom_02":NOM Prénom",

    ...

    }}

    I would like to cherge this file to complete my WebStorage.

    It would be necessary not to destroy the others datas of my WebStorage.

    I try that:

    Event ------------------------------------------ Action

    Syst. On start of layout ------------------- Ajax Request liste.json (tag "a")

    Ajax On "a" completed WebStorage -- Set local storage from JSON string AJAX.LastData

    Mouse On any clic---------------------------Text1 Set text to AJAX.LastData

    ---------------------------------------------------Text2 Set text to WebStorage.AsJSON

    The text1 show realy the good list of names, but not the text2 wiich say me that the data charged is empty: ({"c2dictionary":true,"data":{}})

    How to do ?

    Thanks

  • example.capx

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thank's Korbaach,

    but all my appli is built with Webstorage ! and it would be a very big work all to rebuild. My next appli do...

    Do you see why my text2 don't show my Json?

  • hi !

    i can now charged a json file with Ajax and then open it in my webstorage (my old file had a syntax error)

    but i can't open directly the json file in the webstorage withe this line:

    on start of layout..........Webstorage Set Local Storage from Json string "monfichier.txt"

    is it normal ?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)