How do I update a JSON file with an AJAX using actions and events ?

0 favourites
  • 2 posts
From the Asset Store
Fantasy Game includes more than 600 sound effects inspired by hit computer games like World of Warcraft and Diablo.
  • Let's say you have imported a file into the Construct project and you called it "theme.json". The code inside reveals to be an array code in JSON. And then you add an array plugin named "ThemeArr". Using AJAX, we can make the array have the same elements and values as in the theme.json file. We can load a JSON file into an array, but what about the opposite? How do we overwrite a JSON file with the Array.AsJSON?


  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Normally you can't do it. If you need to save modified data, you save it in Local Storage. So on start of the game check Local Storage, and if it has any data, load from there, otherwise load the file included in the project.

    There are some exceptions - if the game is hosted on a web server, you can use a php script to overwrite json file. In NSWJ export you also may be able to update it, if the user has write permission to this folder.

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